0
Having trouble with strings..(C)
So, user types in a string and I store it in an array.. Ex. char arr[20]; // input : "tuna" I check for the end of string using eof... can't find the end. Used the '\0' pointer still doesn't work since I already allocated memory for the string. How do I get the result -> length = 4?
5 Réponses
+ 1
If this you want
https://code.sololearn.com/cxKz4h7Ad6ZC/?ref=app
+ 1
without string header,
https://code.sololearn.com/cNjo45n488gQ/?ref=app
+ 1
Oh.. i wrote it wrong here. I removed that part of the code. Wish I could see if that was the case. Thanks Ketan Lalcheta .
0
MEET MEHTA thanks a lot. Forgot about that function. Ketan Lalcheta I tried that way at first but for some reason it didn't work.
0
Akib Reza might be u were using '/0' in place of '\0'