Hello guys I m trying to code a program to fix indented code but problem is that i will use strstr to search for the for string then i ill read it till it encounted \0 then i wanna jump to next line to add 4 spaces before the code is there a way i can jump to next line ?

Recommended Answers

All 5 Replies

Read the rest of the current line.

yah but how can i ? like for example i ill read for line this
for(i=0;buffer!=0;i++); but that will only read current line i wanna jump to next one like read the for then at end of the after it reached 0 i want to jump to next line to add 4 spaces

like lets say for example this code
for(CODE)
codeishere

it will move it
to
for(code)
codeishere

When you finish reading a line, you are automatically ready to read the next line. So just start reading again and there you are!

srry internet was off anyways i solved it thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.