WackoMike
asked on
minor bug with output
char* site;
site = "http://www.somesite.com/file.php?arg=1&arg2=hrm";
strcat(site,Realm());
MessageBox(0,site,"test",1 );
char*Realm()
{
char* realm;
int one, two = 0;
one = rand(); // this gives player one a dice roll
two = rand(); // this gives player two a dice roll
if (one < two)
{
realm = "UsEast";
}
else
{
realm = "UsWest";
}
return realm;
}
the problem is that it was making my messagebox title the last part of the realm like ast or est
site = "http://www.somesite.com/file.php?arg=1&arg2=hrm";
strcat(site,Realm());
MessageBox(0,site,"test",1
char*Realm()
{
char* realm;
int one, two = 0;
one = rand(); // this gives player one a dice roll
two = rand(); // this gives player two a dice roll
if (one < two)
{
realm = "UsEast";
}
else
{
realm = "UsWest";
}
return realm;
}
the problem is that it was making my messagebox title the last part of the realm like ast or est
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok fixed it instead of using
site = "url";
i used
strcat(site,"url");
site = "url";
i used
strcat(site,"url");
ASKER
this seems to only cause more memory errors down the road...
I am sorry I missed out the strcat(...) after memory allocation.
You allocate memory and then do a strcat(...). This is ideal way to do it.
Thanks for points :-)
You allocate memory and then do a strcat(...). This is ideal way to do it.
Thanks for points :-)
ASKER