Bonjour,
Je suis d�butant.
J'ai programm� un exe qui permet d�extraire une base de donn�es. mes arguments sont le r�pertoire du fichier source et destinataire.
Je mets mes arguments au hasard dans le raccourci mais je r�cup�re 0 0 (affichage d'argument).
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include <string> #include <stdio.h> using namespace std; int main(int argc, char *argv[]) { /*if (argc < 2) { // We expect 3 arguments: the program name, the source path and the destination path std::cerr << "Usage: " << argv[0] << "SOURCE DESTINATION" << std::endl; return 1; }*/ std::string launchGbak = "\"C:\\Program Files (x86)\\ServerSQL\\Firebird_2_5\\bin\\gbak.exe\" -USER DBA -PASSWORD 1234 -BACKUP "+atoi(argv[1])+ atoi(argv[2]); std::string pause = "exit"; for (int i = 1; i < argc; i++) cout << atoi(argv[i]) << endl; system(launchGbak.c_str()); system(pause.c_str()); system("pause"); return 0; }
Pouvez-vous m'aider pour ex�cuter mon programme avec des arguments.
Merci!
Bien cordialement,
Partager