There is such code:
char tmpBuff[255]; fgets(tmpBuff, 255, stdin); NSString *tmpStr = [[NSString alloc] initWithBytes:tmpBuff length:255 encoding:NSASCIIStringEncoding];
But the problem is that garbage is also copied to the string. I enter "Hello World!". Tried to process with the help stringByTrimmingCharactersInSet
but did not help. Tell me how to correctly read the input from the console to the string.