problem with a function defination
hey
this is my main.c... Code:
#include "allheader.h" Code:
#include "ftplib.h" after compiling i am getting the following error....... main.c: In function 'bool ftp_write(std::string, std::string, std::string, std::string, std::string)': main.c:7: error: a function-definition is not allowed here before '{' token main.c:17: error: expected `}' at end of input any help appreaciated....... |
You are missing a } bracket in this area:
Code:
... Code:
if (condition) { |
Another thing to consider:
This is plain procedural code, using only an ISO C library, in files called *.c, and you STILL write C++, using e.g. the std::string class for nothing else than accessing the char* inside. Try writing real C instead, use C++ for projects that actually USE its features. Reasons to do so: - portability - no symbol mangling (binary compatibility with libs) - not confusing others who may work on the code later - not carrying unneeded stuff in the final binary I'm NOT AT ALL advocating against C++ here, I just hate to see C-code in C++ ;) Oh and: Don't do implementation in header files. In your example.h file, just give the prototype like Code:
int whatever(char *foo, int baz); |
thanks a lot both of you!!
|
All times are GMT -5. The time now is 06:04 PM. |