Skip to main content

Using Character Pointer

#include <iostream>
using namespace std;

int main()
{
    char s[12] = "programming";
    char *sp = &s[0];
    *sp = 'P';


    cout << *sp << endl; // P
    cout << sp << endl;  // Programming

 

    system("pause");

    return 0;
}

Comments