I have the following code:
typedef struct
{
int a;
int b;
} Hello;
typedef struct
{
char c;
int d;
} World;
Hello hello[10][10];
World world[5];
Then I have the following functions:
void getInfo(Hello hello_p[][10], World* world_p)
{
// Here I suppose to get the size of pointer to the array of hello and world
sizeof(hello_p);
sizeof(world_p);
}
void getHello(Hello (** hello_p)[10])
{
hello_p = hello;
}
void getWorld(World ** world_p)
{
world_p = world;
}
then I call the function like:
Hello (*hello_p)[10] = NULL;
World *world_p = NULL;
getHello(&hello_p);
getWorld(&world_p);
getInfo(hello_p, world_p);
then in the getInfo function, can I get the size of the pointer to the array of hello
and world
?