[ create a new paste ] login | about

Link: http://codepad.org/so6ktkb3    [ raw code | output | fork ]

C, pasted on Nov 1:
1
2
3
4
5
6
7
8
9
#include <stdio.h>
int main(int argc, char *argv[])
{
    const char a[] = "Hello";
    const char *b = a;
    a = b;  /* Not allowed. */
    printf("%s\n", b);
    return 0;
}


Output:
1
2
3
In function 'main':
Line 6: error: assignment of read-only variable 'a'
Line 6: error: incompatible types in assignment


Create a new paste based on this one


Comments: