c - go to a line and change to uppercase -
I'm trying to do this work basically has a file with 10 lines ... using argv [ ] The user enters the file name in the location 1 and the row number is 2 in the array.
Everything is working so far ... check the file ... count of line numbers and so on
What would you guys suggest that I use the letters of that line To convert to upper I am losing with how to do this. We can just use lseek, open, write, read and stop order
My argument was ... if the user entered the line to change the number 5 ... in the program, I count the line numbers .... when the counter hits 4.... After that there is a few lines 5 ... up to \ n
each \ Increasing counters on n increases
integer line; Int counter = 0; Four c; Do {line = read (FD, AND, 1); If (C == '\ n') {counter ++; } If (lnum == counter) {}} while (line! = 0);
You're just going to change the line, keeping it in the same shape, You can overwrite it (no need to rewrite the file) since you have already received a way to read the lines, where you start your position (in the number of bytes, thanks for reading the function ). So you read the row you want to change in uppercase, you replace the position indicator (using lseek) at the beginning of the line, and then you want them to rewrite the reading line with the changes.
Comments
Post a Comment