raz0rblade
06-08-2003, 08:51 PM
Anyone know why im getting this when I compile ?
[zero@demon dbbackup]$ g++ main.cpp
main.cpp: In function `int do_backup(const std::string&)':
main.cpp:35: parse error before string constant
main.cpp:36: parse error before string constant
main.cpp:46:1: warning: no newline at end of file
[zero@demon dbbackup]$
Heres my code:
#include <iostream>
#include <fstream>
#include <string>
#include "backup.h"
int main() {
system("php -q /usr/local/bin/list.php > /etc/list");
std::string db;
std::ifstream ifs("/etc/list");
while (!ifs.eof()) {
std::getline(ifs, db);
do_backup(db);
}
ifs.close();
return 0;
}
int do_backup(const std::string& db){
system("mv /home/backup/"db".sql1 /home/backup/"db".sql2");
system("mysqldump -u root -p3frkqe5x "db "> "db".sql1");
return 0;
}
[zero@demon dbbackup]$ g++ main.cpp
main.cpp: In function `int do_backup(const std::string&)':
main.cpp:35: parse error before string constant
main.cpp:36: parse error before string constant
main.cpp:46:1: warning: no newline at end of file
[zero@demon dbbackup]$
Heres my code:
#include <iostream>
#include <fstream>
#include <string>
#include "backup.h"
int main() {
system("php -q /usr/local/bin/list.php > /etc/list");
std::string db;
std::ifstream ifs("/etc/list");
while (!ifs.eof()) {
std::getline(ifs, db);
do_backup(db);
}
ifs.close();
return 0;
}
int do_backup(const std::string& db){
system("mv /home/backup/"db".sql1 /home/backup/"db".sql2");
system("mysqldump -u root -p3frkqe5x "db "> "db".sql1");
return 0;
}