ok laserlight so what is the correct syntax for declaring pointers to arrays and the way to access them?
http://www.cplusplus.com/doc/tutorial/pointers.html
under section "Pointers and Arrays"...
Type: Posts; User: Luciferek
ok laserlight so what is the correct syntax for declaring pointers to arrays and the way to access them?
http://www.cplusplus.com/doc/tutorial/pointers.html
under section "Pointers and Arrays"...
OK
int main()
{
int v[3]={3,2,3};
int (* b)[3] = &v;
cout<< b[1];
cin.get();
}
Man this is confusing...
int main()
{
int v[3]={3,2,3};
int (* b)[3] = v;
cout<< b[1];
cin.get();
}
gives me an error
well no... I do not need parentheses for one dimentional arrays
int main(void){
int v[3]={3,2,3};
int *b=v;
cout<< b[1];
cin.get();
}
OK..
I can live with
int (*p)[3][2] = x;
It is somewhat consistent with other pointer declarations.
But than again... how do i figure out when do I need parentheses when declaring pointers...
So, In other words... There is no real advantage to using a new and delete keywords except
that it is accepted as a standard?
Besides why are compilers picky in what they allow and what they do...
Could you elaborate on illegal and what do you mean by that?
If it works, it works... i don't think i'll get arrested!
Besides, are there standards related to C++ code? Where do i find those?
Hey!
I was reading about dynamic memory allocation, and I don't quite get the purpose of it. It says, you can create pointer to an array you don't know the size
of yet. Why not create an array...
And again I am furious with C++. There is no way of predicting how to point to something. I would never in my lifetime guess
int (*)[3][2] p = x;
that (*)... is that a typecast?
I...
hi!
how would I declare a pointer to point to this array?
int x[3][3][2]={1,2,3,2,3,4,5,7,9,1,2,3,2,3,4,5,7,9};
Also is there a way to pass an array with variable dimension idexes to a...
ok I guess the tutorial i am reading is shady,
it says that:
void procedure (int myarray[][3][4])
is a valid function prototype
but when I try
hello!
I am trying to call a function that has multi dimensional array as one of its arguments. My Dev C++ gives me crap with this code:
#include <iostream>
using namespace std;
void...
Does anyone know of a tutorial or a lesson on Preprocessor Directives?
I looked at MSDN Visual C++ refrence material but it is written in such a way that I barely understand it. I am looking for...
Yep...
reminescing over the good ole college days...
I only wish my proffessors weren't nazis.
Hey
I was wondering what is the difference between classes unions and structs?
They all seem to be the same
Hello
I am looking for resources on Directives and Macros. Something like an indepth tutorial or chapter from book dedicated to that topic would be great
Thank you!
Yep that did the trick!
But this leads me to another bunch of questions.
Doesn't GetProcAddress function give you just the adress of Out32 ?
Why do we need to typecast if the pointer is of...
ok, but if you try
void (*outport)(short adress, short value) = (void)GetProcAddres(Dllload, "Out32");
that doesn't work niether. Is there any other way other than typedef?
I am trying to create a pointer that would point to Out32 function in inpout32.dll.
and the following code does not work, can someone give me more insight about
why it doesnt work?
#include...
How does result = result?
I don't really get operator precedence in this case either;
if inc_one(1) is a pointer, and pointer is considered a variable
So it would make more sense to me that *...
So in other words, * operator as well as & operator are optional for normal functions and are mandatory for class functions?
Is * mandatory for class functions? Since a.fooptr(); is wrong?
Hmm I...
I started studying pointers and i am becoming confused...
When you have pointer and that pointer has adress of another variable you need to use * derefrencing operator to access the value that is...
Thank you for those links, it is what I needed. And I have another question about Hinstance. From this tutorial
What kind of objects can be instances? Could .exe file be the instance? How about...
Hello,
I am looking for materials (tutorials, lessons etc) on linking to a dll.
With code examples & explanations. The code by itself doesn't help me much.
What is HInstance and what does it...