Hey Guys, This is my first post here at cplusplus.com!
I'm a newbie in C++ so I don't really know that much about the language.
I just wanted to ask if I can change the value of a variable without any user input. Basically I want the variable to be 0 when the script starts and when it gets to a certain point it should be 1.
I know of cin but from what I know it requires user input.
The assignment operator (reference below) will do just that! Simply define (or declare) a variable and then use the assignment operator when you feel the need to change the value already being stored in the variable. I have posted an example below.
What are the types of these two variables: musicindex and musicfileextenstion. If you have a compiler that supports the new standard, then there is no need to invoke the member function "c_str()". The new standard has included an overloaded "open" member function that takes a std::string object as an argument (reference below).
EDIT: I've also noticed that you are incorrectly using the std::ifstream object. The operator being used in your code is not overloaded in the std::ifstream class (<<). I believe you are confusing the std::ifstream class with the std::ofstream class (read, write). I have included references to both of these classes below.
musicindex and musicfileextenstion (I noticed that I spelled extension wrong :P) are strings the value of musicindex is index and the value of musicfileextenstion is .music . Im using Dev-C++ .
So basically with the new standard it would be something like: