|
-
April 4th, 2007, 06:27 PM
#1
Little question about char convertion
Hello!
I've been using sprintf to convert a group of integers to a char sequence.
like this:
char st[];
int a=2,b=3;
sprintf(st,"%d and %d",a,b);
cout<<st;
it works good, but when trying to use char *st; instead of the array an error is thrown.
"Error while dumping state (probably corrupted stack)"
if sprintf receives a char * as first argument, shouldn't it work too?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|