Thanks for the suggestion. I tried it, but it didn't work. However, I spoke with somebody who gave me another suggestion which did work, namely to enclose the string in single quotes within the existing double quotes.
So while
char ssid[] = "name with spaces"; //double quotes only
fails, the following works
char ssid[] = "'name with spaces'"; //single quotes inside double quotes