strcmp in C/C++

Samual Sam
Updated on 24-Jun-2020 11:06:18

27K+ Views

The function strcmp() is a built-in library function and it is declared in “string.h” header file. This function is used to compare the string arguments. It compares strings lexicographically which means it compares both the strings character by character. It starts comparing the very first character of strings until the characters of both strings are equal or NULL character is found.If the first character of both strings are equal, it checks second character and so on. This process will be continued until NULL character is found or both characters are unequal.Here is the syntax of strcmp() in C language, int ... Read More

Extern Keyword in C

Samual Sam
Updated on 24-Jun-2020 11:03:45

20K+ Views

External variables are also known as global variables. These variables are defined outside the function. These variables are available globally throughout the function execution. The value of global variables can be modified by the functions. “extern” keyword is used to declare and define the external variables.Scope − They are not bound by any function. They are everywhere in the program i.e. global.Default value − Default initialized value of global variables are Zero.Lifetime − Till the end of the execution of the program.Here are some important points about extern keyword in C language, External variables can be declared number of times ... Read More

asinh Function in C++ STL

Arjun Thakur
Updated on 24-Jun-2020 11:03:19

198 Views

The asinh() function returns the arc hyperbolic sine or the inverse hyperbolic sine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the asinh() function is given as follows.asinh(var)As can be seen from the syntax, the function asinh() accepts a parameter var of data type float, double or long double. The value of this parameter can be anything i.e negative, positive or 0. It returns the arc hyperbolic sine of var.A program that demonstrates asinh() in C++ is given as follows −Example Live Demo#include #include using namespace std; int main() {   ... Read More

Relational and Logical Operators in C

Samual Sam
Updated on 24-Jun-2020 11:02:49

22K+ Views

Relational OperatorsRelational operators are used to compare two values in C language. It checks the relationship between two values. If relation is true, it returns 1. However, if the relation is false, it returns 0.Here is the table of relational operators in C languageOperatorsOperator Name==Equal to>Greater than=Greater than or equal toy)    printf("x is greater than y ");    if(x

fseek in C/C++

Samual Sam
Updated on 24-Jun-2020 11:01:26

2K+ Views

fseek() in C language, is use to move file pointer to a specific position. Offset and stream are the destination of pointer, is given in the function parameters. If successful, it returns zero. If it is not successful, it returns non-zero value.Here is the syntax of fseek() in C language, int fseek(FILE *stream, long int offset, int whence)Here are the parameters used in fseek()stream − This is the pointer to identify the stream.offset − This is the number of bytes from the position.whence − This is the position from where offset is added.whence is specified by one of the following ... Read More

ftell Function in C

karthikeya Boyini
Updated on 24-Jun-2020 11:00:53

11K+ Views

In C language, ftell() returns the current file position of the specified stream with respect to the starting of the file. This function is used to get the total size of file after moving the file pointer at the end of the file. It returns the current position in long type and file can have more than 32767 bytes of data.Here is the syntax of ftell() in C language, long int ftell(FILE *stream)Here is the parameter used in ftell(), stream − This is the pointer to a FILE object that identifies the stream.Here is an example of ftell() in C ... Read More

Register Keyword in C

karthikeya Boyini
Updated on 24-Jun-2020 10:59:13

10K+ Views

Register variables tell the compiler to store the variable in CPU register instead of memory. Frequently used variables are kept in registers and they have faster accessibility. We can never get the addresses of these variables. “register” keyword is used to declare the register variables.Scope − They are local to the function.Default value − Default initialized value is the garbage value.Lifetime − Till the end of the execution of the block in which it is defined.Here is an example of register variable in C language, Example Live Demo#include int main() {    register char x = 'S';    register int ... Read More

Sinh Function in C++ STL

Chandu yadav
Updated on 24-Jun-2020 10:57:45

200 Views

The sinh() function returns the hyperbolic sine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the sinh() function is given as follows.sinh(var)As can be seen from the syntax, the function sinh() accepts a parameter var of data type float, double or long double. It returns the hyperbolic sine of var.A program that demonstrates sinh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double d = 5, ans;    ans = sinh(d);    cout

Ternary Operators in C/C++

karthikeya Boyini
Updated on 24-Jun-2020 10:57:13

2K+ Views

The operators, which require three operands to act upon, are known as ternary operators. It can be represented by “ ? : ”. It is also known as conditional operator. The operator improves the performance and reduces the line of code.Here is the syntax of ternary operator in C language, Expression1 ? Expression2 : Expression3Here is an example of Ternary Operators in C language, Example Live Demo#include int main() {    int a = -1;    double b = 26.4231;    int c = a? printf("True value : %lf", b):printf("False value : 0");    return 0; }OutputTrue value : 26.423100Expression1 ... Read More

Cosh Function in C++ STL

Arjun Thakur
Updated on 24-Jun-2020 10:56:50

192 Views

The cosh() function returns the hyperbolic cosine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the cosh() function is given as follows.cosh(var)As can be seen from the syntax, the function cosh() accepts a parameter var of data type float, double or long double. It returns the hyperbolic cosine of var.A program that demonstrates cosh() in C++ is given as follows −Example Live Demo#include #include using namespace std; int main() {    double d = 5, ans;    ans = cosh(d);    cout

Advertisements