Error: 'CLSS' was not declared inside this scope?
<p>Why isn't my function 'CSS()' working in this code, the error is:</p>

<pre><code>C:\Users\KEstudio\Desktop\Programming\Learning C++ resources\projects\homework     saver\main.cpp||In function 'int main()':|
C:\Users\KEstudio\Desktop\Programming\Learning C++ resources\projects\homework    saver\main.cpp|20|error: 'CLSS' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|
</code></pre>

<p>Here is my code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
using namespace std;

void ClSS()
{
    system("CLS");
}
const char* CTS(string);

int main()
{
    A:
    string HWS, HW;//We will be saving our input in this
    cout &lt;&lt; "Please enter the homework subject:" &lt;&lt; endl;
    getline(cin, HWS);
    CLSS();

    cout &lt;&lt; "Please enter the homework:" &lt;&lt; endl;
    getline(cin, HW);
    CLSS();

    ofstream myfile;
    myfile.open(CTS(HWS+".txt"));
    myfile &lt;&lt; HW;
    myfile.close();

    cout &lt;&lt; "You have saved the information to a file! :D" &lt;&lt; endl;

    string SEL;
    bool ASEL=false;
    cout &lt;&lt; "Do you wan't to add another entry? yes or no" &lt;&lt; endl;
    getline(cin, SEL);
    system("CLS");
    if(SEL=="yes" || SEL=="Yes" || SEL=="YES" || SEL=="Y" || SEL=="y")
        ASEL=true;
    else
        ASEL=false;
    if(ASEL==true)
        goto A;
    return 0;
}

const char* CTS(string strng)
{
    const char* FON;
    FON=strng.c_str();
    return FON;
}
</code></pre>

<p>I can see that my function IS declared, I'm aware that C++ wouldn't have bugs like this, so I AM doing something wrong, there is no way that this is a bug with C++, so please, tell me what i'm doing wrong (Hopefully it's not completely dumb so i don't look too stupid, although with a code like this, it probably will be a simply solution)
Sorry for rambling on here, stack overflow has made me type more detail.</p>

<p>Ok I can see that CLSS is declared above the main function, and functions don't need to be declared inside the main function for them to work inside it.</p>
