![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
passing arg 1 of `write' makes integer from pointer withouta castHi, I encounter this problem, where there are 10 warnings for every read/write operation I've done. I'm using GCC compiler to compile it. Here is my code. As far as I know, it means that the first argument (char*)&ConfValue need to be integer, but It was works in another code, declared as char. I really dont know how to debug it.
Anyone can help me? Thank you |
|
#2
|
|||
|
|||
|
Hi this is the code, spicode.doc. Pls take a look. Thank u
|
|
#3
|
|||
|
|||
|
Hi,
You have confused between "fopen" and "open". open returns file descriptor for the opened file which is an integer. You are casting it to be a pointer. It is wrong. "fopen" returns pointer not "open" CPP / C++ / C Code:
should be CPP / C++ / C Code:
So is the problem with read() and write(). They expect first argument to be an integer file descriptor "fd" where as you are passing a pointer "fd". Hence the warnings. Correcting above "open" code should supress all the warnings. |
Recent GIDBlog
Developing GUIs with wxPython (Part 3) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2D arrays:dynamic allocation and freeing | bravetanveer | C Programming Language | 48 | 27-Nov-2007 15:55 |
| Passing referance and passing pointer | Poolan | C++ Forum | 6 | 29-Oct-2004 07:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The