some C fun


int main()
{
char charptr[30], ch[30];
scanf("%s %*s %s", charptr, ch);
printf("%s %s", charptr, ch);

scanf("%3c", ch);
printf("%s", ch);
system("PAUSE");
}

can’t test cin.scan in windows (as GNU extension is not ported in g++/win32)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s