![]() |
|
#1
|
|||
|
|||
Problem to acess to a dynamic stringhi
in my main i do: CPP / C++ / C Code:
in my searchFile i do: CPP / C++ / C Code:
in my analyzeFileName i do: CPP / C++ / C Code:
in my readFile i do: CPP / C++ / C Code:
why in my analyzeFilename function, after the call function to readFile i get NULL when i printf led_line? i want to do some action to led_line after the readFile... but i get NULL how to resolve that? thanks Last edited by LuciWiz : 25-Mar-2005 at 09:23.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
|||
|
|||
|
Quote:
You pass led_line (a pointer to char) to readFile(). Inside readFile(), you set the value of readFile()'s local copy of led_line to the allocated storage. This does not affect the value of led_line in the calling program. One way around this is to pass the address of led_line (therefore a pointer to a pointer to char). An example: CPP / C++ / C Code:
Regards, Dave |
Recent GIDBlog
US Elections and the ?Voter?s Responsibility? by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read a .html file, check that file for links | salemite | C Programming Language | 10 | 17-Jan-2008 08:56 |
| Problem with string and serial port | collinm | C Programming Language | 13 | 25-Mar-2005 08:39 |
| Please help! Dynamic binary tree problem | robsmith | C Programming Language | 3 | 15-Mar-2005 22:20 |
| C++ string from file | small_ticket | C++ Forum | 3 | 05-Jan-2005 08:29 |
| problem reading to a dynamic array | noamfrie | C Programming Language | 9 | 02-Jan-2005 19:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The