![]() |
program runtime fault
Hi
In my program ****tion main() is Code:
int main() While running the program I get Code:
MarBattery v.1.0 Code:
unsigned char getinfo(battery_state_raw batvar_raw, bool closefile = true) Code:
#define trashit() getline(datadump, *trash) // I couldn't make a function and don't wanna write it over and over ;) extractdata() Code:
#define rawatof(data) bat.data=atof(tmpraw.data.c_str()) // I'm too lazy to write it so many times ;D class battery_state Code:
class battery_state in battery_state_raw Code:
public: what can i do? thanks for all |
Re: program runtime fault
First of all: stop being lazy. Remove the #define lines and write the code. Copy paste is cheap. Especially if you need to debug your code.
If you want to see what all your macros are expanded to, use the -E flag to your compiler, assuming you're using g++, and inspect the result. As to the debugging: if you think that you need to use new to get a string instance, rewrite your code after figuring out what the call to getline() actually does. Regarding asking for help: include how you compile it, including all warnings that you get. I'm very certain that you get quite a few... And don't make friends if you don't have to. Having naked functions as friends indicates some other problem. |
Re: program runtime fault
It was some problem with "new-created" variable. I made it normail var and it's ok
|
All times are GMT. The time now is 16:42. |
vBulletin® Version 3.8.8