Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How string organised is in %s scanf

$
0
0
int j=0;
char buf[100];
scanf("%s", buf);
while(buf[j]!='\0')
{
j++;
}


for example let's give input "we are". Why j=2? It should terminated after secound word

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>