C set variable

Lenovo / 42334dg
April 17, 2009 at 03:37:24
Specs: Microsoft Windows Vista Home Premium, 2 GHz DualCore/ 2041 MB
Hi, I was wondering if it's possible to set a variable like this;
char a[20];
char b[20] = "Whatever";
a = ("%s", b);

just like the way printf works. it's the way a is set im going for.

Live the life as you know it
/ Wille


See More: C set variable

Report •


#1
April 17, 2009 at 08:03:49
If you want to do format some variables and output the text into a string variable instead of a file/screen, you can use sprintf.

Report •

#2
April 17, 2009 at 08:16:15
Ok i'll try that thanks.

Live the life as you know it
/ Wille


Report •

Related Solutions


Ask Question