WP
Jan 7th, 2001, 01:15 PM
Hi,
I made a program in C++ and now I will pass parameters to it. I used this:
#include <iostream>
#include <ctype.h>
#include <fstream>
#include <string>
#define cls() system("cls");
using namespace std;
int myinteger;
int main(int argc, char* argv[])
{
myinteger = argv[1]; //the first parameter in a number
return 0;
}
he gives the error of the reinterpret_cast stuff, so I added these:
int main(int argc, char* argv[])
{
myinteger = reinterpret_cast <int> (argv[1]); //the number in the parameter was 5, but he returns 8392093 !!!
return 0;
}
any idea's ? :(
WP
I made a program in C++ and now I will pass parameters to it. I used this:
#include <iostream>
#include <ctype.h>
#include <fstream>
#include <string>
#define cls() system("cls");
using namespace std;
int myinteger;
int main(int argc, char* argv[])
{
myinteger = argv[1]; //the first parameter in a number
return 0;
}
he gives the error of the reinterpret_cast stuff, so I added these:
int main(int argc, char* argv[])
{
myinteger = reinterpret_cast <int> (argv[1]); //the number in the parameter was 5, but he returns 8392093 !!!
return 0;
}
any idea's ? :(
WP