pointer & struct

Dinh Vu dvu at pyr.gatech.EDU
Fri Feb 3 00:15:48 AEST 1989


I am learning C, and having difficulty with pointers, and
structures.  The small program below compiled fine, but
it gave core dump when I run it.  Would someone give me 
some light on this matter.


	 #include <stdio.h>
	
	struct abc {
		int x;
		int y;
	};

	main()
	{
		struct abc *var;

		var->x = 5;
		var->y = 10;
	}




======================================================================
Why have sex today, when you can have it tomorrow!
					-a horny procrastinator

Dinh Vu
Georgia Insitute of Technology, Atlanta Georgia, 30332
...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!dvu
======================================================================



More information about the Comp.lang.c mailing list