Found 7346 Articles for C++

fseek() in C/C++

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

1K+ 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

asinh() function in C++ STL

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

104 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

acosh() function in C++ STL

Chandu yadav
Updated on 24-Jun-2020 10:53:32

95 Views

The acosh() function returns the arc hyperbolic cosine or the inverse hyperbolic cosine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the acosh() function is given as follows.acosh(var)As can be seen from the syntax, the function acosh() accepts a parameter var of data type float, double or long double. The value of this parameter should be greater than or equal to 1. It returns the arc hyperbolic cosine of var.A program that demonstrates acosh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double ... Read More

tanh() function in C++ STL

George John
Updated on 24-Jun-2020 10:54:11

97 Views

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

atanh() function in C++ STL

Ankith Reddy
Updated on 24-Jun-2020 10:55:29

87 Views

The atanh() function returns the arc hyperbolic tangent or the inverse hyperbolic tangent of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the atanh() function is given as follows.atanh(var)As can be seen from the syntax, the function atanh() accepts a parameter var of data type float, double or long double. The value of this parameter should be between -1 and 1. It returns the arc hyperbolic tangent of var.A program that demonstrates atanh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double d = ... Read More

cosh() function in C++ STL

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

112 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

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

sinh() function in C++ STL

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

88 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

strpbrk() in C++

George John
Updated on 24-Jun-2020 10:47:19

231 Views

This is a string function in C++ that takes in two strings and finds the first occurrence of any character of string2 in string1. It returns the pointer to the character in string1 if there is any, otherwise returns NULL. This is not applicable for terminating NULL characters.The syntax of strpbrk() is given as follows −char *strpbrk(const char *str1, const char *str2)In the above syntax, strpbrk() returns the pointer to the first character in str1 that matches any character in str2.A program that demonstrates strpbrk() is given as follows.Example Live Demo#include #include using namespace std; int main() {   ... Read More

strncat() in C++

Ankith Reddy
Updated on 24-Jun-2020 10:49:01

422 Views

The function strncat() in C++ is used for concatenation. It appends the specified number of characters from the source string at the end of the destination string and returns a pointer to the destination string. The syntax of strncat() is given as follows.char * strncat ( char * dest, const char * src, size_t num );In the above syntax, the source string src is appended at the end of the destination string dest till num characters only.A program that demonstrates strcat() is given as follows.Example Live Demo#include #include using namespace std; int main() {    char str1[20] = "Programming ... Read More

Advertisements