I'm currently learning C programming and I have come across this weird output.
// Program will try functionalities of the scanf function
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char const *argv[])
{
char array[40];
scanf("Enter your address: %39s",array); //39 + 1/o null character at the end of the character array.
printf("The address is : %s", array);
return 0;
}
It should accept input address and output the same.
PS C:\Users\G\Documents\C programs> gcc scanff.c -o scanff -Wall -pedantic -std=c99
PS C:\Users\G\Documents\C programs> ./scanff
jhgjhg
The address is : ■ a
What is that black block? Could someone explain! Thanks.