I'm having this problem in solving the transfer of alphabet into pointer.
Below is my code:
I know it's easier to use array and cstring but I purposely write it in pointer form, which will be incorporated into my serial communication code later.Code:#include <iostream> using namespace std; void main() { char* ReadChain; *ReadChain = 'A'; *(ReadChain + 1) = 'B'; *(ReadChain + 2) = 'C'; cout<<"Result = "<<ReadChain<<endl; }
Any help and suggestion is well appreciated. Thanks!