#include "stdafx.h"
#include<iostream>
#include<conio.h>
#include<ctime>
using namespace std;
int *p[10][20];//
int _tmain(int argc, _TCHAR* argv[])
{
cout<<sizeof(*p)<<endl;
getch();
return 0;
}
output: 80
but i cannot understand how it work.
usama sadaqat
0
Newbie Poster
Recommended Answers
Jump to PostWhat don't you understand?
You are creating a pointer to an array and trying to output the size, this is not allowed sice the compiler does not know what the pointer is pointing to.
In your cose, you woud not not need a pointer, it would just work lik this:
…
Jump to PostYou are creating a pointer to an array
No, he's not. He's creating an array of arrays of pointers.
and trying to output the size, this is not allowed sice the compiler does not know what the pointer is pointing to.
Yes, it's allowed and yes, …
All 5 Replies
phorce
131
Posting Whiz in Training
Featured Poster
usama sadaqat
0
Newbie Poster
sepp2k
378
Practically a Master Poster
ddanbe
commented:
Nice!
+14
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sepp2k
378
Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.