What Happens When a Function is Called Before Its Declaration in C

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

336 Views

If we do not use some function prototypes, and the function body is declared in some section which is present after the calling statement of that function. In such a case, the compiler thinks that the default return type is an integer. But if the function returns some other type of value, it returns an error. If the return type is also an integer, then it will work fine, sometimes this may generate some warnings.Example Code#include main() {    printf("The returned value: %d", function); } char function() {    return 'T'; //return T as character }Output[Error] conflicting types for 'function' ... Read More

Set Blank Spaces in Column Names with MySQL

Anvi Jain
Updated on 30-Jul-2019 22:30:25

996 Views

To set blank spaces in column names with MySQL, you can use the concept of backticks. Let us first create a table. Following is the query −mysql> create table blankSpacesDemo    -> (    -> `Student Id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> `Student Full Name` varchar(100)    -> ); Query OK, 0 rows affected (0.51 sec)Following is the query to insert some records in the table using insert command −mysql> insert into blankSpacesDemo(`Student Full Name`) values('John Smith'); Query OK, 1 row affected (0.16 sec) mysql> insert into blankSpacesDemo(`Student Full Name`) values('Carol Taylor'); Query OK, 1 row ... Read More

Ignore Duplicate Rows in Count

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

5K+ Views

Yes, we can ignore duplicate rows in COUNT using DISTINCT. Following is the syntax:select count(distinct yourColumnName) from yourTableName;In MySQL, COUNT() will display the number of rows. DISTINCT is used to ignore duplicate rows and get the count of only unique rows.Let us first create a table:mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstName varchar(10) ); Query OK, 0 rows affected (0.47 sec)Following is the query to insert some records in the table using insert command:mysql> insert into DemoTable(FirstName) values('Larry'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(FirstName) values('John'); Query OK, ... Read More

FloatBuffer hasArray Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

104 Views

It can be checked if a buffer has the backing of an accessible float array by using the method hasArray() in the class java.nio.FloatBuffer. This method returns true if the buffer has the backing of an accessible float array and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public class Demo {    public static void main(String[] args) {       int n = 5;       try {          FloatBuffer buffer = FloatBuffer.allocate(5);          buffer.put(4.5F);          buffer.put(1.2F);         ... Read More

Reading Images Using Python

Nitya Raut
Updated on 30-Jul-2019 22:30:25

8K+ Views

Image Processing Using OpenCVOpenCV(Open source computer vision) is an open source programming library basically developed for machine learning and computer vision. It provides common infrastructure to work on computer vision applications and to fasten the use of machine learning in commercial products.With more than 2.5 thousand optimized algorithms for both computer vision and machine learning are both classic and state-of-the-art algorithms. With so many algorithms, makes it to use the library for multiple purposes including face detection & recognization, identify objects, classify human actions in videos, track camera movements, join images together to produce a high resolution image of an ... Read More

Remove White Spaces for TextView in Android

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

2K+ Views

This example demonstrates How to remove white spaces for textview in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken name and when user click on button it will remove editext value and append values to textview.Step 3 − Add the following code to ... Read More

Pass Check Boxes Data Using JSP

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

4K+ Views

Checkboxes are used when more than one option is required to be selected.Following is an example HTML code, CheckBox.htm, for a form with two checkboxes.                     Maths           Physics           Chemistry                     The above code will generate the following result − Maths  Physics  Chemistry Following is main.jsp JSP program to handle the input given by the web browser for the checkbox button.           Reading Checkbox Data               Reading Checkbox Data                Maths Flag:                                  Physics Flag:                                  Chemistry Flag:                               The above program will generate the following result −Reading Checkbox DataMaths Flag :: onPhysics Flag:: nullChemistry Flag:: on

Use Concept in Android TextView

Smita Kapse
Updated on 30-Jul-2019 22:30:25

152 Views

This example demonstrate about How to use concat () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and concat with tutorialspoint.com string.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

monthDay isValidYear Method in Java

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

98 Views

It can be checked if a year is valid or not for a MonthDay object using the isValidYear() method in the MonthDay class in Java. This method requires a single parameter i.e. the year which is to be checked. Also, it returns true if the year is valid for a MonthDay object and false if the year is not valid for a MonthDay object.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class Demo {    public static void main(String[] args) {       MonthDay md = MonthDay.parse("--02-21");       System.out.println("The MonthDay is: " + ... Read More

Duration plusSeconds Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

124 Views

An immutable copy of a duration where some seconds are added to it can be obtained using the plusSeconds() method in the Duration class in Java. This method requires a single parameter i.e. the number of seconds to be added and it returns the duration with the added seconds.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Duration; public class Demo {    public static void main(String[] args) {       Duration d = Duration.ofSeconds(12);       System.out.println("The duration is: " + d);       System.out.println("A copy with 5 seconds added to the duration is: ... Read More

Advertisements