Ok, So this isn't specific to classes, but since I have this thread open I'll go ahead and post it in here
I have a float being passed into a function. The float is a combination of two numbers, the first being year, second being date. I have it set up to be year.date, so say 1998.07 would be july 1998.
I need some help seperating the two though(if it's possible) This is what I have
where yearMonth is being passed into the function as something like 1998.07.
float year, month;
year = yearMonth/1;
month = yearMonth % year;
the error is as follows
Keep in mind that I'm getting this yearMonth number from inside of a different function, so I can't pass it as two seperate numbers(not that I can see anyway).
136 C:\Dev-Cpp\add_data.cpp invalid operands of types `float' and `float' to binary `operator%'
Any help is appreciated!
I'm trying to save the info that I get to a file. The file should be named by the number of the month in a folder by year.
gives the error
dataFile.open("C:\\"year "\\"month".dat", ios::out);
I don't get it, is there a way to have a dynamic file out location?
207 C:\Dev-Cpp\add_data.cpp invalid operands of types `const char' and `float' to binary `operator+'