Samual Sam has Published 2492 Articles

Structures in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:50:01

832 Views

Structure is a user defined datatype. It is used to combine the different types of data into single type. It can have multiple members and structure variables. The keyword “struct” is used to define structures in C language. Structure members can be accessed by using dot(.) operator.Here is the syntax ... Read More

size_t data type in C

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:47:14

8K+ Views

The datatype size_t is unsigned integral type. It represents the size of any object in bytes and returned by sizeof operator. It is used for array indexing and counting. It can never be negative. The return type of strcspn, strlen functions is size_t.Here is the syntax of size_t in C ... Read More

fgets() and gets() in C

Samual Sam

Samual Sam

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

1K+ Views

fgets()The function fgets() is used to read the string till the new line character. It checks array bound and it is safe too.Here is the syntax of fgets() in C language, char *fgets(char *string, int value, FILE *stream)Here, string − This is a pointer to the array of char.value − ... Read More

delete() and free() in C++

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:44:07

1K+ Views

delete()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 ... Read More

Isprint() in C++

Samual Sam

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

When to use i++ or ++i in C++?

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:36:30

1K+ Views

Increment operators are used to increase the value by one while decrement works opposite. Decrement operator decrease the value by one.Pre-increment (++i) − Before assigning the value to a variable, the value is incremented by one.Post-increment (i++) − After assigning the value to a variable, the value is incremented.Here is ... Read More

modf() in C/C++

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:35:27

298 Views

The function modf() is used to split the passed argument in integer and fraction. It is declared in “math.h” header file for the mathematical calculations. It returns the fractional value of passed argument.Here is the syntax of modf() in C language, double modf(double value, double *integral_pointer);Here, value − The value ... Read More

Java Program to multiply long integers and check for overflow

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:30:04

1K+ Views

To check for Long overflow, we need to check the Long.MAX_VALUE with the multiplied long result, Here, Long.MAX_VALUE is the maximum value of Long type in Java.Let us see an example wherein long values are multiplied and if the result is more than the Long.MAX_VALUE, then an exception is thrown.The ... Read More

Java Program to decode string to integer

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:27:21

399 Views

The method Integer.decode() decodes a string to an integer. It returns an Integer object holding the int value represented by the passed string value.Note − It accepts decimal, hexadecimal, and octal number.Let’s say the following is our string.String val = "2";The following is how you can decode the string to ... Read More

Java Program to check whether the entered value is ASCII 7 bit alphabetic

Samual Sam

Samual Sam

Updated on 26-Jun-2020 07:16:35

92 Views

To check whether the entered value is ASCII 7-bit alphabetic, check the character from ‘a’ to ‘z’ or ‘A’ to ‘Z’.Here, we have a character.char one = 'r';Now, we have checked a condition with if-else to check for character from ‘a’ to ‘z’ or ‘A’ to ‘Z’.if ((one >= 'A' ... Read More

Advertisements