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 4320632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:39:18+00:00 2026-05-21T08:39:18+00:00

When i execute this code #include<stdio.h> int main() { int (*x)[5]; printf(\nx = %u\nx+1

  • 0

When i execute this code

#include<stdio.h>

int main() {
 int (*x)[5];
printf("\nx = %u\nx+1 = %u\n&x = %u\n&x + 1 = %u",x,x+1,&x,&x+1);
}

This is the output in C or C++:

x = 134513520
x+1 = 134513540
&x = 3221191940
&x + 1 = 3221191944

Please explain. Also what is the difference between:

int x[5] and int (*x)[5] ?

  • 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-21T08:39:18+00:00Added an answer on May 21, 2026 at 8:39 am
    • int x[5] is an array of 5 integers
    • int (*x)[5] is a pointer to an array of 5 integers

    When you increment a pointer, you increment by the size of the pointed to type. x+1 is therefore 5*sizeof(int) bytes larger than just x – giving the 8048370 and 8048384 hex values with a difference of 0x14, or 20.

    &x is a pointer to a pointer – so when you increment it you add sizeof(a pointer) bytes – this gives the bf9b08b4 and bf9b08b8 hex values, with a difference of 4.

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

Sidebar

Related Questions

How exactly does fork() work? The following code #include <stdio.h> int main (int argc,
I have been trying to execute this program on my MinGW, through Code::Blocks: #include
#include stdio.h int main() { int x = -13701; unsigned int y = 3;
#include <stdio.h> #define MAXLENGTH 77 int getline(char[], int); main() { char in_line[MAXLENGTH]; int count,
I used threads in this code. but when I execute this code in shell,
everybody out there i write a very simple c code which is following: #include<stdio.h>
This code is executed by many way. When it's executed by the form button
Considering this code, can I be absolutely sure that the finally block always executes,
I am getting this error on a remote server, but the same code executes
I am trying to execute this SQL query prior to restoring a .BAK file

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.