| | |
Merging 2 Files
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
0
#11 26 Days Ago
C++ Syntax (Toggle Plain Text)
int main() { std::string fn1(""); std::string fn2(""); std::string out(""); merge(fn1, fn2, out); return 0; }
Я из Молдавии. Говорю на Русском.
0
#12 26 Days Ago
This solution has one condition. Both the original file must be the same size, otherwise copying will occur until the reach the end of the smallest file.
PS
Since the function requires arguments of type "const std::string &", then it can pass arguments to the type "const char *". In this case, in the stack will be created temporary object of type "const std::string", which destructed when you exit the function body.
ex.:
PS
Since the function requires arguments of type "const std::string &", then it can pass arguments to the type "const char *". In this case, in the stack will be created temporary object of type "const std::string", which destructed when you exit the function body.
ex.:
C++ Syntax (Toggle Plain Text)
merge("file1.txt", "file2.txt", "outfile.txt");
Last edited by niXman; 26 Days Ago at 3:52 am.
Я из Молдавии. Говорю на Русском.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Structures
- Next Thread: Explanation of code line by line
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets






