Sto scrivendo un mail sender in C++ ma sono bloccato da un problema........
codice:// main .cpp #include <iostream> #include <cstdlib> #include <cstring> #include "mail.h" using namespace std; int main( int argc, char *argv[] ) { system( "PAUSE" ); return 0; }codice:#ifndef MAIL_H_ #define MAIL_H_ #include <string> using namespace std; // sending mail void send( mail *, string, string, string, char*[] ); // the max size of mail object #define BUFFER 2048 struct mail { string from;// the sender string to;// the receiver string object;// the object char *text[BUFFER];// the text string header;// the complete header }; void send( mail * ml, string from, string to, string object, char* text[BUFFER]) { if( ( from == " " ) || ( to == " " ) || ( object == " " ) || ( strcmp(text, " ") == true ) ) { cout << "A part of the email is null, retry\t"; return; }else{ ml->from = from; ml->to = to; ml->object = object; ml->text = text; } /* this part of function create the mail header and prepare it to send but I can't do at time :/ */ } #endifCompilatore: Default compiler
Building Makefile: "C:\Documents and Settings\Francesca\Desktop\Luca\Progetti C++\mail\Makefile.win"
Esecuzione di make...
make.exe -f "C:\Documents and Settings\Francesca\Desktop\Luca\Progetti C++\mail\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include"
In file included from main.cpp:5:
mail.h:7: `mail' was not declared in this scope
mail.h:7: parse error before `,' token
mail.h: In function `void send(mail*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, char**)':
mail.h:22: cannot convert `char**' to `const char*' for argument `1' to `int
strcmp(const char*, const char*)'
mail.h:30: incompatible types in assignment of `char**' to `char*[2048]'
make.exe: *** [main.o] Error 1
Esecuzione terminata
Tnk 1000k