Erorr's

I dunno now how to fix it, also, you can recommend me a site for telling what is those errors?

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  #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>

using namespace std;
string n;
string f1;
string flf;
string f2;
stringstream ss;
stringstream rr;

int main (void)
{
    WIN32_FIND_DATA FindFileData;
    HANDLE hFind;

    flf = "*.*";

    cout<<"Enter file's location: "<<endl;
    cin >> f1;

    rr = f1+flf;

    const char szInitialDir[] = (rr.str().c_str());

    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<<"Witch you want to run?"<<endl;
    cin >> n;

    ss << "start " << f1 << n;
    system (ss.str().c_str());

    //the end

    return 0;

    return EXIT_SUCCESS;
}


error's:
1
2
3
4
5
6
7
8
9
10
||=== 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|30|error: no match for 'operator=' (operand types are 'std::stringstream {aka std::basic_stringstream<char>}' and 'std::basic_string<char>')|
F:\Projects\C++\Code Blocks\Mine\Detect Name Files\main.cpp|30|note: candidate is:|
F:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\sstream|502|note: std::basic_stringstream<char>& std::basic_stringstream<char>::operator=(const std::basic_stringstream<char>&)|
F:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\sstream|502|note:   no known conversion for argument 1 from 'std::basic_string<char>' to 'const std::basic_stringstream<char>&'|
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: 3 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|


Im new in c++, sorry for my english, this is not an homework, just an personal project! Thanks in advance!
rr = f1+flf; you can't assign a std::string to a std::stringstream.

1
2
rr << f1;
rr << flf;
Thank you but it fixed only 1 error, there's 2 more error's"
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|33|error: initializer fails to determine size of 'szInitialDir'|
F:\Projects\C++\Code Blocks\Mine\Detect Name Files\main.cpp|33|error: array must be initialized with a brace-enclosed initializer|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|


I still dunno now how to fix this :P
*This is not an homework!*
Topic archived. No new replies allowed.