Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!fluke!ssc-vax!lee
From: lee@ssc-vax.UUCP (Lee Carver)
Newsgroups: comp.sys.apollo
Subject: Allocate space (was NOT Re: How does ios_dir_$open work?)
Summary: Where's your space?????
Message-ID: <1130@ssc-bee.ssc-vax.UUCP>
Date: 18 Aug 88 17:26:40 GMT
References: <8808122122.AA14782@mailgw.cc.umich.edu> <8180@cup.portal.com>
Organization: Boeing Aerospace Corp., Seattle WA
Lines: 22

In article <8180@cup.portal.com>, Jinfu@cup.portal.com writes:
| I don't understand why following codes don't work:
| #include 
| #include 
| 
| main(argc, argv)
| int      argc;
| char    *argv;
| {
| char    *str1;
| strcpy(str1, argv[1]);
| }
| 
| The runtime error is 'access violation'.

Of course it doesn't work!!  In this program, str1 is a pointer to a
sequence of characters.  But where is the space for the sequence of
characters?

I guess I'm hot about this because you used my Subject: to bring up
a unrelated issues.  This is a simple C usage issue.  Learn the
language (or computer science in general).