I am not sure why you would want to do that.
Yet, theoretically, I suppose that you could write an encryption/decryption algorithm. Before compiling, you'd run all your strings through it and get "encrypted strings". After that, you would need to decrypt all strings in order to use them. Yet, if it is a simple one, it will most likely easily be broken, since it isn't that hard to step through the decryption process in a debugger/disassembler.
So, just "hypothetically", assume that you have a string "Hello!" that turns into "ar11z#" after it's been encrypted. You'd have to run the decryption function at run-time and get the resulting string, "Hello!", but the string you'd effectively "write" in C(++) code would be "ar11z#", probably with a nice comment saying what it is -- But it really would be in memory, then.