Hi. I have a program that goes a little like this:

// Include files, etc...

int main()

//code...


if (input == "logout");
{
    return main();
}


// rest of the code

Now, every time the program goes to main, the values previously stored in the varibles are still there. I am looking for a way to start with a clean slate and wipe all of the variables.

Recommended Answers

All 2 Replies

Member Avatar for iamthwee

Just reset the variables to an empty string

input = "";

You probably shouldn't be "going to main". Remove the return main(); part and change it to a loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.