Posts

Showing posts from May, 2023

Strings

 ʺaʺ versus ‘a’ -->  'a’ is a single character value (stored in 1 byte)   while  ʺaʺ is an array with two characters, the first is a, the second is  \0 (null character).

Input Intricacies

Must see for specific input taking Scanf Details # include <stdio.h> int main () {     int m , n ;     scanf ( "(%d)-%d" , & m , & n );     printf ( "%d %d \n " , m , n );     // scanf accept input only if it is in same format as specified     // eg.- here if u write (8) 6 => 8 is in format           =>m=8 but n=0 (by default) bcz not used '-'     scanf ( " (%d) - %d" , & m , & n );     printf ( "%d %d \n " , m , n );     // spaces doesn't matter at start or in between     scanf ( "(%d)-%d " , & m , & n );     printf ( "%d %d \n " , m , n ); // never give space at end bcz compiler ko lgta hai ek aur value hai aage and when u give 1 extra inputs then only it stops . => only first input get stored. *******************************************************************     int a ;     char c ; ...