Karthikeya Boyini has Published 2383 Articles

Difference between strlen() and sizeof() for string in C

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 08:07:54

785 Views

strlen()The function strlen() is a predefined function in C language. This is declared in “string.h” header file. It is used to get the length of array or string.Here is the syntax of strlen() in C language, size_t strlen(const char *string);Here, string − The string whose length is to be calculated.Here ... Read More

Convert decimal integer to hexadecimal number in Java

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 08:06:13

265 Views

To convert decimal integer to hexadecimal, use the Integer.toHexString() method. Let’s say the following is our decimal integer.int decInt = 25;The following is the usage of the Integer.toHexString() method to convert decimal integer to hexadecimal number.String myHex = Integer.toHexString(decInt);The following the complete example.Example Live Demopublic class Demo {    public static ... Read More

atexit() function in C/C++

karthikeya Boyini

karthikeya Boyini

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

310 Views

The function atexit() is used to call the function after the normal exit of program. The program is called without any parameters. The function atexit() is called after exit(). The termination function can be called anywhere in the program. This function is declared in “stdlib.h” header file.Here is the syntax ... Read More

Union in C

karthikeya Boyini

karthikeya Boyini

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

556 Views

Union is a user defined datatype. All the members of union share same memory location. Size of union is decided by the size of largest member of union. If you want to use same memory location for two or more members, union is the best for that.Unions are similar to ... Read More

isgreaterequal() in C/C++

karthikeya Boyini

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

Java Float Wrapper Class

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

Float is a wrapper class provided to wrap float primitive value.Let us create a Float object with float primitive.// float primitive float myFloat = 24.22f; // Float object Float obj1 = new Float(myFloat);Let us now create a Float object from string.Float obj2 = new Float("39.87");The following is an example that ... Read More

calloc() versus malloc() in C

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 08:01:39

2K+ Views

calloc()The function calloc() stands for contiguous location. It works similar to the malloc() but it allocate the multiple blocks of memory each of same size.Here is the syntax of calloc() in C language, void *calloc(size_t number, size_t size);Here, number − The number of elements of array to be allocated.size − ... Read More

fopen() for an existing file in write mode in C

karthikeya Boyini

karthikeya Boyini

Updated on 26-Jun-2020 07:57:29

525 Views

The function fopen() opens the file pointed by pointer and read or write the file. In the write mode, “w” is used and in the read mode, “r” is used.When a file exists in the directory, it treats as a new empty file and override the content of file by ... Read More

isblank() in C/C++

karthikeya Boyini

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

delete() operator in C++

karthikeya Boyini

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

Advertisements