www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/03/15:08:32

From: "K.A.R.L." <farega AT usc DOT es>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: SIGSEV hates me
Date: Mon, 03 Feb 1997 18:49:58 +0100
Organization: Universidade de Santiago
Lines: 29
Message-ID: <32F62546.391@usc.es>
References: <32F56281 DOT 2014 AT dmv DOT com>
Reply-To: farega AT usc DOT es
NNTP-Posting-Host: mclacopo.usc.es
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Pyro Technic wrote:
> 
> My prog is a stupid little prog for a math problem. It's due in 14
> hours. I need help bad.The prog, B low, compiles w/ just 1 warning
> 
> D:\PROGS>gxx -o TOG.exe TOG#2.cpp
> TOG#2.cpp: In function `int main(...)':
> TOG#2.cpp:30: warning: implicit declaration of function `int getch(...)'



>                 for(j=3; j>=0; ++j)
				  ^ shouldn't it be --j?
				otherwise I would say that this is an
				endless loop, no? (j grows allways, so 				it is allways bigger than
0)
				
>                         {
>                         temp = (int)num1 % 10;
>                         digit[j]=temp;
>                         num1 /= 10;
>                         num1 -= (temp/10);
>                         }


To get rid of the warning I think you must include stdio.h this way:
#include <stdio.h>

Hope this helps!

- Raw text -


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