[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Cpp Question
From: |
Matjaž Janežič |
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] Cpp Question,
Matjaž Janežič <=