home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12668 < prev    next >
Encoding:
Text File  |  1992-08-22  |  1.2 KB  |  49 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!darwin.sura.net!rsg1.er.usgs.gov!news.cs.indiana.edu!umn.edu!lynx!triton.unm.edu!rsahu
  3. From: rsahu@triton.unm.edu (Raikanta Sahu)
  4. Subject: Another simple C question
  5. Message-ID: <!+-n84@lynx.unm.edu>
  6. Date: Sun, 23 Aug 92 03:14:59 GMT
  7. Organization: University of New Mexico, Albuquerque
  8. Distribution: unm
  9. Lines: 38
  10.  
  11. Here is another problem I am facing in compilation with our RISC compiler
  12. in triton @ unm.
  13. ------------------------------------------------------------------------
  14. #include <stdio.h>
  15.  
  16. main(argc, argv)
  17. int argc ;
  18. char *argv[] ;
  19. {
  20.  
  21.   char infile[50] ;
  22.  
  23.  if(argc == 1)
  24.  {
  25.     printf("Give input file : ") ;
  26.     scanf("%s", infile) ;
  27.   }
  28.   else
  29.     infile = argv[1] ;
  30.  
  31.  getinput(infile) ;
  32.  
  33. }
  34. ------------------------------------------------------------------------
  35.  
  36. Here is the message of the compiler : 
  37.  
  38.  
  39.  
  40. ccom: Error: check.c, line 16: illegal lhs of assignment operator
  41.           infile = argv[1] ;
  42.       ---------------------^
  43.  
  44. Isn't it legal to assign a pointer to a character to a character array ?
  45. Somebody mentioned to me that RISC is not an ANSI compatible compiler. Is
  46. that so ?
  47.  
  48. -sahu,r 
  49.