KayacanV's blog

By KayacanV, 12 years ago, In English

how can i read to c++ string from position one not zero

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If you are using char*, you can make sth like

char s[1000];
gets(s + 1);
or
scanf("%s", s + 1);
»
12 years ago, hide # |
 
Vote: I like it -20 Vote: I do not like it
    char temp[1000];
    gets(temp + 1);
    temp[0] = ' ';  // Some char that should stay in 0's position in your string
    string s(temp)