c++ - using 'new' operator -


i have simple task concerning 'new' operator. need create array of 10 chars , input chars using 'cin'. should ? :

char c = new char[10]; for(int i=0; < 10; i++) {     cin >> char[i] >> endl; } 

no. try char* c = new char[10];.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -