Hi I'm trying to make a program that deletes the first line of a file, but when I compile it the exe is dinamically linked to MSVCR100.dll (I'm using Visual Studio 2010, but I guess it would be MSVCRTX.dll being X the version, for example MSVCRT90.dll if it was VS 2008).
I would like to ask 3 things:
Is there any way to compile and don't depend on MSVCRT (or depend on MSVCRT.dll, I mean the one that comes with Windows)?
The "main" syntax, can it be easier or do I have to stick with it? Which one is the standard?
And finally, is there any better way to implement it?
Thanks in advance.
Code:#include <string> #include <fstream> #include <iostream> #include <tchar.h> int _tmain(int argc, _TCHAR* argv[]) { std::string line; std::ifstream in ("Files"); std::ofstream out ("Files.tmp"); if (!in.is_open ()) { std::cout << "Input file failed to open.\n"; return 1; } getline (in, line); while (getline (in, line)) { out << line << "\n"; } in.close (); out.close (); remove ("Files"); rename ("Files.tmp", "Files"); return 0; }



LinkBack URL
About LinkBacks




.