Hi forum, i dont know how to fix some errors. I try more different ways to fix it but same error's at line 33. Thanks in advance!
*Sorry for my english*
*This is not an homework!*
*Im new in c++"
#if defined (_UNICODE) || defined (UNICODE)
#error "Unicode not supported - use Multi-Byte Character Set"
#endif
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <sstream>
usingnamespace std;
string n;
string f1;
string flf;
string f2;
stringstream ss;
string rr;
int main (void)
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
flf = "*.*";
cout<<"Enter file's location: "<<endl;
cin >> f1;
rr =f1 + flf;
constchar szInitialDir[] = rr;
printf ("Initial directory: %s", szInitialDir);
hFind = FindFirstFileA (szInitialDir, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
printf ("Error: %lu ", GetLastError ());
system ("pause");
return EXIT_FAILURE;
}
do
{
printf ("\nFile: %s", FindFileData.cFileName);
} while (FindNextFileA (hFind, &FindFileData));
FindClose (hFind);
system ("pause");
cout<<"Which you want to run?"<<endl;
cin >> n;
ss << "start " << f1 << n;
system (ss.str().c_str());
return 0;
return EXIT_SUCCESS;
}
Errors:
1 2 3 4 5 6
||=== Build: Debug in Detect Name Files (compiler: GNU GCC Compiler) ===|
F:\Projects\C++\Code Blocks\Mine\Detect Name Files\main.cpp||In function 'int main()':|
F:\Projects\C++\Code Blocks\Mine\Detect Name Files\main.cpp|32|error: initializer fails to determine size of 'szInitialDir'|
F:\Projects\C++\Code Blocks\Mine\Detect Name Files\main.cpp|32|error: array must be initialized with a brace-enclosed initializer|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 3 second(s)) ===|
I still dunno now how to fix those error's, please help me! Thanks in advance!