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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:18:27+00:00 2026-05-31T13:18:27+00:00

This programme shows only one output Hiii if the size of the words array

  • 0

This programme shows only one output “Hiii” if the size of the words array is not passed from the main function.
If size is generated inside disp function shows
Size: 48
Size: 2
Hiii

If size is passed from main function shows
Size: 48
Size: 48
Hiii
Hello
Hello There
Hello World

#include<stdio.h>
#include<conio.h>

void disp(char words[][12],int size)
{
 int i,j;
 char *p,*cp;
 p=words;
 size=sizeof(words);
 printf("Size %d\n",size);
 for(cp=p;cp<(p+size);cp+=12)
 {
  printf("%s",cp);
  printf("\n");
 }
}

void main()
{
 char words[][12]={"Hiii","Hello","Hello There","Hello World"};
 int size;
 clrscr();
 size=sizeof(words);
 printf("Size %d\n",size);
 disp(words,size);
 getch();
}

Programme compiled in Borland Turbo C

  • 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-31T13:18:28+00:00Added an answer on May 31, 2026 at 1:18 pm

    In C, the syntax for passing an array is actually just a another way of saying you are passing a pointer. For example:

    void f(int a[])
    

    is just another way of saying

    void f(int *a)
    

    It is a special syntax in the language, and it is meant to make the parameters more self documenting, but it can also be confusing in situations like what you are describing.

    In your case, the declaration:

    void disp(char words[][12],int size)
    

    is actually saying

    void disp(char (*words)[12],int size)
    

    That is, words is a pointer to an array of 12 characters. And the size of a pointer is two bytes in your case.

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

Sidebar

Related Questions

This is the output to my program from this link (http://www.rottentomatoes.com/movie/box_office.php). As you can
I'm not quite sure how to google search this or put it into one
Part of a programme builds this list, [u'1 x Affinity for war', u'1 x
I am not professional programmer so i can not be sure about this.How many
I am having a problem with one of my team members output. He seems
I was following one of the thread to run perl scripts from my c#
I have no one else to count unless this fantastic community, I know this
I have an overridden ToString() method that I want to output formatted data. This
This is the edited question with full problem. Following is the table structure. (Only
I'm quite lost on this one and I hope someone here could help. My

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.