Found 7346 Articles for C++

strtod() function in C/C++

karthikeya Boyini
Updated on 26-Jun-2020 08:10:10

314 Views

The function strtod() is used to convert the string to a floating point number. The string is converted into double type number. It returns the converted number, if successful otherwise, zero. This is declared in “stdlib.h” header file.Here is the syntax of strtod() in C language, double strtod(const char *string, char **endpointer);Here, string − The string to be converted.endpointer − The pointer of already allocated object and its value is set to the next character by the function after the numeric value.Here is an example of strtod() in C language, Example Live Demo#include #include int main () {   ... Read More

isgreaterequal() in C/C++

karthikeya Boyini
Updated on 26-Jun-2020 08:03:19

154 Views

The function isgreaterequal() is used to check that the first argument is greater than or equal to the second one. It is declared in “math.h” header file in C language. It returns true on success, otherwise false.Here is the syntax of islessgreater() in C++ language, bool isgreaterequal(value1 , value2);Here, value1 − This is the first argument which will be checked with value2.value2 − This is the second argument which is used to check value1 that is greater or equal.Here is an example of isgreaterequal() in C++ language, Example Live Demo#include #include using namespace std; int main() {    int val1 = ... Read More

strchr() function in C/C++

Samual Sam
Updated on 26-Jun-2020 08:03:47

288 Views

The function strchr() is used to search the character in the string. It search the first occurrence of character which is passed as second argument and it returns a pointer to the character, if successful otherwise, NULL.Here is the syntax of strchr() in C language, char *strchr(const char *string , int character)Here, string − The string which is to be scanned to search the character.character − The character which is to be searched in the string.Here is an example of strchr() in C language, Example Live Demo#include #include int main() {    char s[] = "Helloworld!";    char c = 'o'; ... Read More

strxfrm() in C/C++

karthikeya Boyini
Updated on 26-Jun-2020 07:51:52

235 Views

The function strxfrm() transforms the source string to the current locale and copies the first number of characters of transformed string to the destination. It is declared in “locale.h” header file in C language.Here is the syntax of strxfrm() in C language, size_t strxfrm(char *destination, const char *source, size_t number)Here, destination − The destination pointer where the characters will be copied.source − The string is to be transformed.number − The number of characters to be copied.Here is an example of strxfrm() in C language, Example#include #include int main () has {    char s[10] = "HelloWorld";    char ... Read More

islessequal() in C/C++

Samual Sam
Updated on 26-Jun-2020 07:52:25

151 Views

The function islessequalr() is used to check that first argument is less than or equal to the second. It is declared in “math.h” header file. It returns true, if successful otherwise false.Here is the syntax of islessequal()bool islessequal(value1 , value2);Here, value1 − This is the first argument which will be checked with value2.value2 − This is the second argument which is used to check value1 that is less or equal.Here is an example of islessequal()Example Live Demo#include #include using namespace std; int main() {    int val1 = 8;    int val2 = 8;    bool result;    result = islessequal(val1, ... Read More

iswpunct() function in C/C++

Samual Sam
Updated on 26-Jun-2020 07:53:21

118 Views

The function iswpunct() is used to check that the passing wide character is a punctuation or not. It returns zero, if it is not a punctuation, otherwise it returns a non-zero value. It is declared in “cwctype” header file.Here is the syntax of iswpunct()int iswpunct(wint_t character);Here is an example of iswpunct()Example#include #include using namespace std; int main() {    wint_t a = '!';    wint_t b = 'a';    if(iswpunct(a))    printf("The character is a punctuation.");    else    printf("The character is not a punctuation.");    if(iswpunct(b))    printf("The character is a punctuation.");    else    printf("The character is not ... Read More

delete() operator in C++

karthikeya Boyini
Updated on 26-Jun-2020 07:54:39

339 Views

The delete operator is used to deallocate the memory. User has privilege to deallocate the created pointer variable by this delete operator.Here is the syntax of delete operator in C++ language,delete pointer_variable;Here is the syntax to delete the block of allocated memory,delete[ ] pointer_variable;Here is an example of delete operator in C++ language,Example Live Demo#include using namespace std; int main () {    int *ptr1 = NULL;    ptr1 = new int;    float *ptr2 = new float(299.121);    int *ptr3 = new int[28];    *ptr1 = 28;    cout

iswblank() function in C/C++

Samual Sam
Updated on 26-Jun-2020 07:55:24

143 Views

The function iswblank() is used to check that the passed wide character is blank or not. It is basically a space character and it also considers tab character(\t). This function is declared in “ctype.h” header file in C language and “cctype”” header file in C++ language.Here is the syntax of isblank() in C++ language, int iswblank(wint_t char);Here is an example of iswblank() in C++ language, Example Live Demo#include #include using namespace std; int main() {    wchar_t s[] = L"The space between words.";    int i = 0;    int count = 0;    while(s[i]) {       ... Read More

isblank() in C/C++

karthikeya Boyini
Updated on 26-Jun-2020 07:56:11

614 Views

The function isblank() is used to check that the passed character is blank or not. It is basically a space character and it also considers tab character(\t). This function is declared in “ctype.h” header file in C language and “cctype”” header file in C++ language.Here is the syntax of isblank() in C++ language, int isblank(int char);Here is an example of isblank() in C++ language, Example Live Demo#include #include using namespace std; int main() {    string s = "The space between words. ";    int i = 0;    int count = 0;    while(s[i]) {       ... Read More

Isprint() in C++

Samual Sam
Updated on 26-Jun-2020 07:42:01

57 Views

The function isprint() is predefined function and it checks that the passed characters are printable or not. It returns non-zero value, if successful otherwise, zero. This function is declared in “cctype” header file.Here is the syntax of isprint() in C++ language,int isprint(int character);Here,character − The character is to be checked.Here is an example of isprint() in C++ language,Example Live Demo#include #include using namespace std; int main() {    int val1 = 28;    int val2 = 's';    int val3 = '';    if(isprint(val1))    cout

Advertisements