www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/23/15:32:11

From: Martin DOT Stromberg AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I'm so new it's frustrating. Almost ready to lose my will to learn.
Date: 23 Aug 1999 13:08:11 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 41
Message-ID: <7prh3r$ese$1@antares.lu.erisoft.se>
References: <1rbw3.17368$x04 DOT 1147413 AT typ11 DOT nn DOT bcandid DOT com>
NNTP-Posting-Host: spica-144.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Daryl Zero (Wobbler AT greenvillenc DOT com) wrote:
: #include <stdio.h>
: 
: void main()
  ^^^^(1)
: {
:      charm me[20];
: 
:      printf("What is your name?")
:      scanf("%s",&me);
:      printf("darn glad to meet you, %s!\n,me);
                                          ^^^(2)

       returrn(0); /* (3) */
: }
: 
: 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.

There's nothing idiotic about asking questions so you can learn things.

You are missing a '"' at (2). This is what the compiler is telling you.

While you're at it, you really should declare main() to return an
"int" at (1) and adding a "return" at (3) to be ANSI-compliant. 

To catch more problems/errors compile with "-Wall". 

Furthermore when in doubt about DJGPP first look in the FAQ
(v2/faq*b.zip) then post here if you can't figure it out. There's also
a C FAQ somewhere (sorry, don't know where) which could be useful for
a C neophyte.


Pettersson, Symphony 16,

							MartinS

- Raw text -


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