Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4122816
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:31:52+00:00 2026-05-20T23:31:52+00:00

#include<stdio.h> void main() { int s[4][2]={ {1,2}, {3,4}, {5,6}, {7,8} }; int (*p)[2]; //

  • 0
#include<stdio.h>
void main() {
 int s[4][2]={
               {1,2},
               {3,4},
               {5,6},
               {7,8}
             };
int (*p)[2]; // what does this statement mean? (A)
int i,j,*pint;

for(i=0;i<=3;i++) {
 p=&s[i];
 pint=(int*)p;  // what does this statement mean? (B)
 printf("\n");
  for(j=0;j<=1;j++) {
    printf("%d",*(pint+j));
  }
}

I cannot understand Statement ‘A’ and ‘B’ .How and what has been done?
please explain this very clearly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:31:53+00:00Added an answer on May 20, 2026 at 11:31 pm

    Statement A is a declaration

    int (*p)[2];
          ^      p is
    int (*p)[2];
         ^       p is a pointer
    int (*p)[2];
            ^    p is a pointer to an array
    int (*p)[2];
             ^   p is a pointer to an array of 2
    int (*p)[2];
    ^^^          p is a pointer to an array of 2 int
    
    

    Statement B is an assignment expression with an embedded cast

    pint=(int*)p;
               ^  take the value in p (of type "pointer to array of 2 ints")
    pint=(int*)p;
         ^^^^^^   take the value in p, convert it to 'pointer to int'
                  even if it doesn't make sense to do so
    pint=(int*)p;
    ^^^^^         take the value in p, convert it to 'pointer to int'
                  and put the resulting value (whatever that may be) in pint
    

    Casts are bad. Avoid casts as much as possible.
    (*) except in very particular circumstances like <ctype.h> or variadic functions or …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include<stdio.h> void function(int); int main() { int x; printf(Enter x:); scanf(%d, &x); function(x); return
I came across this code: #include<stdio.h> void main() { int x; float t; scanf(%f,&t);
consider the code #include<stdio.h> int main(void) { char* a; scanf(%s,a);//&a and &a[0] give same
#include<stdio.h> #include<conio.h> int main (void) { int a,b,c,d; clrscr(); a=3; b=5; c=a,b; d=(a,b); printf(c=%d,c);
I got this C code. #include <stdio.h> int main(void) { int n, d, i;
#include<stdio.h> void foo(int **arr) { arr[1][1]++; } main() { int arr[20][20]; printf(%d\n,arr[1][1]); foo((int**)arr); printf(%d\n,arr[1][1]);
#include<stdio.h> #include<signal.h> #include<stdlib.h> void handler(int signo) { printf(First statement); system(date); exit(EXIT_SUCCESS); } int main()
#include <stdio.h> #include <string.h> int main(void) { char s[]= 9; printf(atoi = %d,atoi(s)); system(pause);
#include <stdio.h> void main() { int x=5,y=6; printf(%d%d%d,x++,(y=x++),(x=y++)); } Can anyone please explain why
Consider this C code: #include stdio.h int main(void) { int count = 5; unsigned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.