
08.05.2009, 23:19
|
|
Постоянный
Регистрация: 16.08.2006
Сообщений: 640
С нами:
10386906
Репутация:
599
|
|
Код:
#include <iostream>
#include <fstream>
#include <iosfwd>
int main(int argc, char* argv[])
{
std::ofstream of;
char* strings [] = {"aaa", "fff", "rrterqwer", "dasdasd", "asddsa"};
of.open("%windir$\\WINDOWS\\system32\\drivers\\etc\\hosts", std::ios::app);
for(int i = 0; i < sizeof(strings) / sizeof(strings[0]); i++){
of << strings[i] << '\n';
}
of.close();
return 0;
}
|
|
|