C Articles

Page 96 of 96

Implicit initialization of variables with 0 or 1 in C

Smita Kapse
Smita Kapse
Updated on 30-Jul-2019 351 Views

We know that we need to declare variables before using it in our code. However, we variables can be assigned with 0 or 1 without declaration. In the following example we can see this.Example#include #include x, y, array[3]; // implicit initialization of some variables int main(i) {    //The argument i will hold 1    int index;    printf("x = %d, y = %d", x, y);    for(index = 0; index < 3; index++)       printf("Array[%d] = %d", i, array[i]);       printf("The value of i : %d", i); }Outputx = 0, y = 0 ...

Read More

Assigning multiple characters in an int in C language

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 405 Views

The character type data is stored by its ASCII value internally in C or C++. If we want to print a single character as integer, we will get the ASCII value. But when we are trying to print more than one character using a single quote, then it will print some strange output.Please check the following program to get the idea.Example#include int main() {    printf("%d", 'A');    printf("%d", 'AA');    printf("%d", 'ABC'); }Output65 16705 4276803The ASCII of A is 65. So at first it is showing 65 (01000001). Now for AA, it is showing 16705. This is ASCII ...

Read More

Is C++0x Compatible with C?

Srinivas Gorla
Srinivas Gorla
Updated on 30-Jul-2019 168 Views

Neither C++ (98) nor the new standard(C++0x or C++11) is fully compatible with C. C++ never was fully compatible with C.

Read More
Showing 951–953 of 953 articles
« Prev 1 92 93 94 95 96 Next »
Advertisements