How do you add a character to an existing string? In java you could just do:

char c='a';
String b="posit";
b+=c;

but I tried doing that in C and it doesnt work. Is there a workaround?

Thanks.

Are you posting your entire homework assignment?

Are you posting your entire homework assignment?

No. Just bits and parts of it I dont understand. Our prof dint really "Teach" us C and is asking us to code. Hence the confusion. Anyways, I found the strcat() function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.