Server Help

Non-Subspace Related Coding - combine chars

hellzlaker - Fri Apr 11, 2008 8:45 pm
Post subject: combine chars
I am trying to do this
Code: Show/Hide


void (char a)
{
a = "bin\\mrs.exe d " + a;
system(a);
}



that didnt compile BUT this did

Code: Show/Hide

void d(char a[40])
{
     a = strcat("bin\\mrs.exe d ",a);
     
     system(a);
}


even tho it compiled, when i open the exe it says unexpected error happened..

any one know how to do what i am trying?
CypherJF - Fri Apr 11, 2008 9:01 pm
Post subject:
i think you're jumping ahead of yourself; learn the core operations of C/C++ (pointers and data structures).

http://www.cplusplus.com/doc/tutorial/
Bak - Fri Apr 11, 2008 11:42 pm
Post subject:
yeah cypher is right
Code: Show/Hide

#include <stdio.h>

...

char a = 'r';
char buf[64];
sprintf(buf,"bin\\mrs.exe d %c",a);

system(buf);

All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group