I have a class String and one of the constructors to the class is String(char c) where it will copy c into buf which is a char*. I'm having some trouble figuring out how to do this. If anyone could help it would be much appreciated.
You need to set buf to an array of two chars. Assign c to the first element in the array, and assign 0 (zero) to the second. The zero byte is the null terminator.