Samual Sam has Published 2492 Articles

raise() function in C/C++

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:05:21

306 Views

The function raise() is used to send the signals to the program. The predefined function signal() is invoked. It is implemented to check whether it will ignore the signal or invoke the signal handler. This is declared in “signal.h” header file. It returns zero, if successful otherwise, non-zero value.Here is ... Read More

Java Float isNaN() Method

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:04:00

126 Views

The isNan() method returns true if the Float value is a Not-a-Number (NaN). Let’s say we have the following Float values.Float f1 = new Float(5.0/0.0); Float f2 = new Float(10.2/0.0); Float f3 = new Float(0.0/0.0);Check with isNaN() method.f1.isNaN (); f2.isNaN (); f3.isNaN ();The following is the complete example with output.Example Live ... Read More

strchr() function in C/C++

Samual Sam

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 , ... Read More

fgetc() and fputc() in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:02:42

4K+ Views

fgetc()The function fgetc() is used to read the character from the file. It returns the character pointed by file pointer, if successful otherwise, returns EOF.Here is the syntax of fgetc() in C language, int fgetc(FILE *stream)Here is an example of fgetc() in C language, Let’s say we have “new.txt” file ... Read More

fseek() vs rewind() in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 08:00:08

2K+ Views

fseek()fseek() in C language is used to move file pointer to a specific position. Offset and stream are the destination of pointer, given in the function parameters. If successful, it returns zero, else non-zero value is returned.Here is the syntax of fseek() in C language, int fseek(FILE *stream, long int ... Read More

Use of realloc() in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:58:12

11K+ Views

The function realloc is used to resize the memory block which is allocated by malloc or calloc before.Here is the syntax of realloc in C language, void *realloc(void *pointer, size_t size)Here, pointer − The pointer which is pointing the previously allocated memory block by malloc or calloc.size − The new ... Read More

Print contents of a file in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:56:43

6K+ Views

Here is an example to print contents of a file in C language, Let’s say we have “new.txt” file with the following content.0, hell!o 1, hello! 2, gfdtrhtrhrt 3, demoNow, let us see the example.Example#include #include void main() {    FILE *f;    char s;    clrscr();    f=fopen("new.txt", "r"); ... Read More

iswblank() function in C/C++

Samual Sam

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 ... Read More

iswpunct() function in C/C++

Samual Sam

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 ... Read More

islessequal() in C/C++

Samual Sam

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 ... Read More

Advertisements