#include <stdio.h>#include <stdlib.h> int main(int argc, char *argv[]){ int *intPtr = NULL; long *longPtr = NULL; int array[5] = {0,1,2,3,4}; intPtr = &array[1]; longPtr = &array[1]; printf("%d\n", *intPtr); printf("%ld\n", *longPtr);}
Standard input is empty
prog.c: In function ‘main’: prog.c:10:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] longPtr = &array[1]; ^ cc1: all warnings being treated as errors
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!