www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/23/14:07:23

From: chris_mears AT softhome DOT net (Chris Mears)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I'm so new it's frustrating. Almost ready to lose my will to learn.
Organization: CHOAM
Message-ID: <37c145ab.21082846@news.bigpond.com>
References: <1rbw3.17368$x04 DOT 1147413 AT typ11 DOT nn DOT bcandid DOT com>
X-Newsreader: Forte Agent 1.5/32.452
MIME-Version: 1.0
Lines: 66
Date: Mon, 23 Aug 1999 13:09:42 GMT
NNTP-Posting-Host: 139.134.194.201
X-Trace: newsfeeds.bigpond.com 935413608 139.134.194.201 (Mon, 23 Aug 1999 23:06:48 EST)
NNTP-Posting-Date: Mon, 23 Aug 1999 23:06:48 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 23 Aug 1999 08:40:32 -0400, "Daryl Zero"
<Wobbler AT greenvillenc DOT com> wrote:

>  I am very knew to programming but I want to learn although it is been
>frustrating. First there was the issue of finding a compiler. (I still
>remember learning that you needed a program in order to wright a program)
>Which was free because I am a cheap ass. Boo. I found Djgpp. Yeah!. I
>downloaded a huge amount of zip files  and read that I had to make a change
>to the autoexecbat file which scared me. Boo, Hiss! I got over my fear and
>installed it and Now I have a compiler. YEAH! However *Ahwww* I am trying to
>learn from a book called c for dummies. I have done about three programs
>that did allright but these are the simpleist of them. The more complicated
>ones (By newbie standards) get error's. Here is an example of one that gets
>error's
>
>#include <stdio.h>
>
>void main()

 main() should return int, not void.

>{
>     charm me[20];
      ^^^^^
 I assume that's a typo, and is meant to be 'char'.
>
>     printf("What is your name?")
>     scanf("%s",&me);

 You don't need to pass the address of 'me', because it's an array.
 That statement can be just:
     scanf("%s", me);

>     printf("darn glad to meet you, %s!\n,me);
                                          ^
You left off the end-quote of that line.  It should go just before the
second comma.

>}

Because main() now returns int, there should be a return statement at
the end, for example:

return 0;


>
>I get the error Error: unterminated string or charcter constant
>                        Error: possible real start of unterminated constant
>                        There were some error's.
>
>I realise I am an idiot but if you could help me anyway and help me
>understand what is going on it would be greatly appreciated.
>

You're not an idiot, just a beginner.  If you want to discuss the
learning of C, read and post to news:alt.comp.lang.learn.c-c++ .  That
newsgroup is *not* for discussing DJGPP-specific matters (but this one
is).  Plus there's news:comp.lang.c for general discussion of the C
programming language.


----------
Chris

Profanity is the one language all computer programmers know.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019