Created
November 28, 2018 07:24
-
-
Save dbc2201/77186aaf9cc32b22745aceb682d68aba to your computer and use it in GitHub Desktop.
The length of the character array remains the same. It is an array afterall!
The problem here is with the input buffer. It might take characters more than
specified at the definition of array but then, your program is likely to misbehave. We need to check for this sort of errors while writing our code. Hence we use #define to define constants fo…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main() | |
| { | |
| char a[] = "hello"; | |
| printf("%s", a); | |
| for( int i = 0 ; i < 4 ; i++ ) | |
| { | |
| scanf("%s", a); | |
| printf("%s", a); // this will help you better understand the working | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment