home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!decwrl!deccrl!caen!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!lynx!triton.unm.edu!rsahu
- From: rsahu@triton.unm.edu (Raikanta Sahu)
- Subject: Simple C question
- Message-ID: <_c+nnmp@lynx.unm.edu>
- Date: Sat, 22 Aug 92 06:22:23 GMT
- Organization: University of New Mexico, Albuquerque
- Distribution: unm
- Lines: 28
-
- I thought the following piece of code was perfectly legal.
- --------------------------------------------------------
- #include <stdio.h>
-
- main()
-
- {
- char s[] = "Hello world!" ;
-
- printf("OK \n" ) ;
- }
- ---------------------------------------------------------
-
- Here is what I get from the compiler.
-
- ccom: Error: test.c, line 6: no automatic aggregate initialization
- char s[] = "Hello world!" ;
- ----------^
- ccom: Error: test.c, line 6: illegal lhs of assignment operator
- char s[] = "Hello world!" ;
- ---------------------------^
-
-
- Can anybody please explain why automatic initialization is not accepted ?
-
- Thanks.
-
- -sahu,r
-