[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Cpp Question
From: |
Derick Schoonbee |
Subject: |
Re: [avr-gcc-list] Cpp Question |
Date: |
Thu, 04 Sep 2003 15:08:04 +0000 |
Join the club .. ;) Did Delphi for many years .. here are some hints to your
Q:
- pointers
- google.com: "by reference" C
- void foo(int &a, int &b, float &c)
From: "Matja¾ Jane¾iè" <address@hidden>
To: <address@hidden>
Subject: [avr-gcc-list] Cpp Question
Date: Thu, 4 Sep 2003 15:16:54 +0200
Hi!
I was recently more involved in Pascal, now I'm in C :)
I'm trying to program a function which returns values as parameters:
void foo(int a, int b, float c)
{
b++;
c=sqrt(a+b)
}
but it does't work
In Pascal it could be done if it is written as
procedure foo(var a,b:integer;var c:real)
begin
b=b+1;
c=sqrt(a+b);
end;
and voila, you get after foo(a,b,c), b incremented and
c as stated :)
but it won't work if the procedure is as that:
procedure foo(a,b:integer; c:real)
begin
b=b+1;
c=sqrt(a+b);
end;
soo after call to that with foo(a,b,c), original a b & c
won't change. how to do this in c?
Regard!
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail