REFERENCE TO ARRAY OF 10 INTEGERS
-
Please give me an example/syntax of:
REFERENCE TO ARRAY OF 10 INTEGERS
Maybe it is very eazy but my super genius stops working for eazy questions... :( ...:doh: ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
Please give me an example/syntax of:
REFERENCE TO ARRAY OF 10 INTEGERS
Maybe it is very eazy but my super genius stops working for eazy questions... :( ...:doh: ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
int a[10]; void fn(int &a) { } Jaime
-
int a[10]; void fn(int &a) { } Jaime
I tried the same myself but i get a bad error WITH THIS....
int fn(int&a)
{
}
int main(int argc, char* argv[])
{
int abb[10];
fn(abb);
return 0;
}ERROR: C:\Windows\Desktop\a\a.cpp(19) : error C2664: 'fn' : cannot convert parameter 1 from 'int [10]' to 'int &' A reference that is not to 'const' cannot be bound to a non-lvalue ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
I tried the same myself but i get a bad error WITH THIS....
int fn(int&a)
{
}
int main(int argc, char* argv[])
{
int abb[10];
fn(abb);
return 0;
}ERROR: C:\Windows\Desktop\a\a.cpp(19) : error C2664: 'fn' : cannot convert parameter 1 from 'int [10]' to 'int &' A reference that is not to 'const' cannot be bound to a non-lvalue ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
Please give me an example/syntax of:
REFERENCE TO ARRAY OF 10 INTEGERS
Maybe it is very eazy but my super genius stops working for eazy questions... :( ...:doh: ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
int[10]&
? --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain." -- Paul Watson, Linux Zombie -
Please give me an example/syntax of:
REFERENCE TO ARRAY OF 10 INTEGERS
Maybe it is very eazy but my super genius stops working for eazy questions... :( ...:doh: ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
I'm too lazy to look this up from a C++ reference, so I'll let the computer answer:
$ c++decl
Type `help' or `?' for help
c++decl> declare a as reference to array 10 of int
int (&a)[10]
c++decl>:)
THANX A LOT 'markkuk'. U are a GENIUS (i mean ur computer) It works. Please please please tell me in which book did u find that syntax.... I was reading C++ from Stroupstrup and in fact... that was a question from the exercises of chapter-5. But i cudnt dig out that particular syntax. thanx. ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
int[10]&
? --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain." -- Paul Watson, Linux Zombieno... this is wrong... i am happy that markuk has given the corect answer. Take a look at his reply. :) thanx anyway ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
THANX A LOT 'markkuk'. U are a GENIUS (i mean ur computer) It works. Please please please tell me in which book did u find that syntax.... I was reading C++ from Stroupstrup and in fact... that was a question from the exercises of chapter-5. But i cudnt dig out that particular syntax. thanx. ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
It is really quite easy to decipher, or create, any simple or complex C/C++ decl, once you know how.. Ever heard of the "right-left rule" ? Again, google is your best friend... Bikram Singh
-
It is really quite easy to decipher, or create, any simple or complex C/C++ decl, once you know how.. Ever heard of the "right-left rule" ? Again, google is your best friend... Bikram Singh