[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asprintf



I had a hard time getting used to char*
When I had to construct a new string I was forced to guess the size
beforehand, so I could malloc the space

char* s;
size_t size;
size=guesize();
malloc(size);
sprintf(s,"qwerty")


But the I discovered asprintf that automatically allocates space for a
string, so now I could:

char* s;
sprintf(&s,"qwerty")

But I cant compile this GNU function with cris ;o((
Any suggestions?

-- 
Martin Hansen
Student at SDU Sønderborg. www.sdu.dk
Writing final project at Danfoss drives. www.danfossdrives.com

Tlf: 74 88 54 62