Skip to content

Instantly share code, notes, and snippets.

@hernad
Created November 25, 2010 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hernad/716062 to your computer and use it in GitHub Desktop.
Save hernad/716062 to your computer and use it in GitHub Desktop.
pr1 ispit snippet
void getline_1() {
char *temp = new char[10], *temp_2 = new char[100];
cout << "unesite TACNO 10 znakova :";
cin.getline(temp, 10);
cin.ignore(100);
cout << "ukucano je :" << temp << endl;
cout << "duzina stringa je " << strlen(temp) << endl;
cout << "unesite/2 TACNO 10 znakova :";
cin.getline(temp_2, 10);
cout << "ukucano je :" << temp_2 << endl;
cout << "duzina stringa je " << strlen(temp_2) << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment