Sender: crough45 AT amc DOT de Message-Id: <97Jun12.133709gmt+0100.16695@internet01.amc.de> Date: Thu, 12 Jun 1997 12:41:07 +0100 From: Chris Croughton Mime-Version: 1.0 To: kdor AT geocities DOT com Cc: djgpp AT delorie DOT com Subject: Re: what am I doing wrong Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Precedence: bulk Kristian Dorland wrote: > I have just installed djgpp for the first time, and I can4t create c- > programs that4s working properly. Every time I run a program compiled > with djgpp, there is somthing wrong with the contents of the integers > and the floatings. An example: > > main() > > { > int one == 1234; > printf("%d",one); > } Well, of course the compiler will get confused because you've called the variable 'one' and then expected it to hold 1234. Try renaming the variable to 'onetwothreefour' so it knows what the value is. Or as a last resort you could read a C manual and find out the difference between '=' and '=='. But I doubt that's your problem because you say the compiler doesn't give an error. It does if I try to compile your program as stated. If, in fact, you had: main() { int one; one == 1234; // should be one = 1234; printf(%d", one); } then that would be the answer. Or if you declared it as a float and then printed it using "%d". Chris