Witam.Piszę sobie aplikacje wysyłająca plik .txt na mój serwer FTP.Niestety , kompilator nie chce go skompilować (używam VisualStudio2013).
Oto mój kod programu:
#include “stdafx.h”
#include <iostream>
#include <fstream>
using namespace std;
void ftpSend(char login, char pass, char path, char serwer)
{
ofstream Plik;
Plik.open(“data.cfg”, ios::out);
Plik << “user ” << login << “ ” << pass << endl << “send ” << path << endl << “quit”;
Plik.close();
char command[256] = “ftp -n -s:data.cfg ”;
strcat(command, serwer);
system(command);
remove(“data.cfg”);
}
int main()
{
ftpSend(“mojlogin”, “mojehaslo”, “C:\\dane\\stats.txt”, ftp.prv.pl);
return 0;
}
A taki komunikat dostaję:
— Build started: Project: ConsoleApplication18, Configuration: Debug Win32 —
1> ConsoleApplication18.cpp
1>c:\users\michal\documents\visual studio 2013\projects\consoleapplication18\consoleapplication18\consoleapplica tion18.cpp(13): error C4996: ‘strcat’: This function or variable may be unsafe. Consider using strcats instead. To disable deprecation, use CRTSECURENO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\string.h(118) : see declaration of ‘strcat’
1>c:\users\michal\documents\visual studio 2013\projects\consoleapplication18\consoleapplication18\consoleapplica tion18.cpp(20): error C2065: ‘ftp’ : undeclared identifier
1>c:\users\michal\documents\visual studio 2013\projects\consoleapplication18\consoleapplication18\consoleapplica tion18.cpp(20): error C2228: left of ‘.prv’ must have class/struct/union
1> type is ‘unknown-type’
1>c:\users\michal\documents\visual studio 2013\projects\consoleapplication18\consoleapplication18\consoleapplica tion18.cpp(20): error C2228: left of ‘.pl’ must have class/struct/union
1>c:\users\michal\documents\visual studio 2013\projects\consoleapplication18\consoleapplication18\consoleapplica tion18.cpp(20): error C2660: ‘ftpSend’ : function does not take 3 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Co jest nie tak ? Co mam robić ?