#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 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, …
Jump to Post
sizeof(int) * 200.
Thats the same as
sizeof(*p)
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.