Hello everyone..
I have char of an array I need to stop reading from the array
if I reache to newline..

the array cosists of characters of a text file but I need to stop
reading when I reache to first \n or endl..
I tried to use this
while(code!='\n'){
xxxxxx
}
but the program doesn't stop reading forever till I stop it.

how can I do that..

hopefully, i will get you help as soon as possible.
thank you in advance..

You do it exactly as you did -- assuming your description is exactly what you have.

Therefore, give us a complete description of
1) where the data come from that gets loaded into the array
2) your code that loads the array
3) the entire code that looks at the array
And use CODE Tags when posting the code.