Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 04-23-08   #1 (permalink)
New to Overclock.net
 
intel nvidia

Join Date: Dec 2005
Posts: 36

Rep: 1 muymoo Unknown
Unique Rep: 1
Trader Rating: 0
Default Passing argument discont. qualifiers error

This is the part of the code that gets the error:

rational rational::add(const rational q) const
{int d1=q.get_denominator();
int denom= denominator;
int f=greatest_common_divisor(denom,d1);
int g=q.get_denominator()/f;
int h=denom/f;
int n=g*numerator + h*q.get_numerator();
int d=g*denom;
rational r(n,d);
r.lowest_terms();
return r;}

when it passes an argument through "greatest common divisor" during compiling, I get the error in the add function:

int rational::greatest_common_divisor(int a ,int b)

{ if(b<0)
{b=-b;}
if(a<0)
{a=-a;}
if(a==0)
{return(b);}
else
if(b==0)
{return(a);}
// a = b*q + r
int q, r;
q = a/b;
r = a%b;
return greatest_common_divisor(b,r);}

Any help would be great. Thanks!
__________________
System: true love
CPU
Conroe e6300 OC 3.23 ghz
Motherboard
Asus P5B
Memory
OCZ Gold DDR2 800 512mbx2 + 1gbx2
Graphics Card
nVidia 7950 gt ko 512mb 579/1710 mhz
Hard Drive
WD 160GB SATA x2
Sound Card
On-board
Power Supply
Generic 550W+Antec 500W
CPU cooling
Swiftech Apogee
GPU cooling
Maze 4
OS
Windows XP SP2
Monitor
Sony 19&quot;
muymoo is offline   Reply With Quote
Old 04-27-08   #2 (permalink)
Programmer
 
Licht's Avatar
 
amd ati

Join Date: Mar 2007
Location: Bel Air
Posts: 8,526
Blog Entries: 3

Rep: 247 Licht is acknowledged by manyLicht is acknowledged by manyLicht is acknowledged by many
Unique Rep: 165
Folding Team Rank: 847
Trader Rating: 0
Default

I greatly advise proper formatting if you want help.

System: AMD-AMD-ATI
CPU
AMD Athlon X2 5200+
Motherboard
Gigabyte 790X AM2+
Memory
2x 1Gb Kingston && 2x 1Gb Wintec
Graphics Card
Saphire HD 3870
Hard Drive
[RAID0] [2X] WD 160GB 7,200RPM
Sound Card
X-Fi Extreme Gamer Fatality Professional
Power Supply
OCZ Game-X-Stream 700w
Case
NZXT Black Steel
CPU cooling
Stock Heatskin & Fan
GPU cooling
Stock Saphire 3870 Cooling
OS
Windows Vista Home Premium x64 SP1
Monitor
Samsung SyncMaster 19" Widescreen
Licht is offline I fold for Overclock.net Licht's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 08:53 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.10733 seconds with 9 queries