LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-23-2004, 06:15 PM   #1
ajacques
LQ Newbie
 
Registered: Oct 2004
Posts: 2

Rep: Reputation: 0
gcc: invalid operands


I'm trying to compile some textbook code and gcc is being a pain in the ass.

It says "invalid operands" for lines that contain something like

scanf("%d%d", &a, &b);

I've decided that it must have to do with the character set with which I'm working, because simple text files will sometimes work without a problem.

I'd like to be able to use KWrite or something visually appealing like that.

Is there an option for gcc that would allow me to process source code in say, ISO-8859-1 format?

Thanks!
 
Old 10-25-2004, 07:31 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
Try having a look at the manual page (man gcc). Be warned, there's a lot of it.

Are you sure the code there is exactly as in the textbook though, and there isn't a space or something between the two %d's though? 'Cause as it is, what you're asking the system to read is two integers, with nothing between them? So how does it know where one number ends and another starts.

For example, given the input 123, is this 12, then 3, or 1, then 23?
Of course, it is possible that I'm on completely the wrong track here.

Just to clarify, what do you mean when you say "simple text files will sometimes work without a problem"?

Anyway, I hope this helps you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare Suse/Novell 3 11-29-2004 02:13 PM
what does "prog7.c:11: error: invalid operands to binary %" mean hubabuba Programming 6 11-16-2004 11:13 AM
squirremail ...it says invalid user or invalid password. rnj Fedora 9 10-25-2004 09:56 PM
invalid module format on kernel 2.6.6 using gcc 3.3 oh_me Linux - Software 0 05-20-2004 09:48 AM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM


All times are GMT -5. The time now is 08:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration