Assign char value to char pointer - C Pointer

C examples for Pointer:Pointer Variable

Description

Assign char value to char pointer

Demo Code

#include <stdio.h>

int main (void)
{
    char c = 'Q';
    char *char_pointer = &c;

    printf ("%c %c\n", c, *char_pointer);

    c = '/';//  w  w w.j  a v a  2  s  .  co m
    printf ("%c %c\n", c, *char_pointer);

    *char_pointer = '(';
    printf ("%c %c\n", c, *char_pointer);

    return 0;
}

Result


Related Tutorials