« first day (1326 days earlier)      last day (1102 days later) » 

12:58 PM
#include<stdio.h>
void main()
{
int a[]={1,2,3,4};
int b[]={5,6,7};
int *p[2];
p[0]=a;
p[1]=&b + 1;
printf("%d\n%d",p[0][0],p[1][1]);
}
pls can u tell me whhy is o/p 1 2
i didnt get how is an 2d array is used in the printf
?
 
Also, this is not Stack Overflow
238
Q: How do I use arrays in C++?

FredOverflowC++ inherited arrays from C where they are used virtually everywhere. C++ provides abstractions that are easier to use and less error-prone (std::vector<T> since C++98 and std::array<T, n> since C++11), so the need for arrays does not arise quite as often as it does in C. However, when you read l...

 
i just wanted to know how is an 2d array is used in the printf
 
^ that's from the ever helpful tag
4 messages moved from Lounge<C++>
3 messages moved from Lounge<C++>
@MarcoA. "pls"? Please consider how impolite that really is.. You can't even type words ("o/p"?) and you demand help? We don't have time for that. There's plenty books in the library.
1 message moved from Lounge<C++>
 

« first day (1326 days earlier)      last day (1102 days later) »