Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
C Articles
Page 96 of 96
Implicit initialization of variables with 0 or 1 in C
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 MoreAssigning multiple characters in an int in C language
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 MoreIs C++0x Compatible with C?
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