Define a structure in c++, C/C++ Programming

Define a structure in C++:

Write a program a structure in c++ program.

void main()

{

                struct player

                {

                char name[20];

                int age,height;

                }    ;

       struct player p[3];

 

                int i,j,k;

                clrscr();

                for (i=0;i<=2;i++)

                    {

                      printf("Enter the name of player %d ,age %d,height %d\n",i+1,i+1,i+1);

                      scanf("%s %d %d",p[i].name,&p[i].age,&p[i].height);

                    }

                                for (i=0;i<=2;i++)

                    {

                       printf("%s %d %d\n",p[i].name,p[i].age,p[i].height);

                    }

       getch();

}

Posted Date: 10/19/2012 3:08:17 AM | Location : United States







Related Discussions:- Define a structure in c++, Assignment Help, Ask Question on Define a structure in c++, Get Answer, Expert's Help, Define a structure in c++ Discussions

Write discussion on Define a structure in c++
Your posts are moderated
Related Questions
What is Ms dos?

Writing and compiling a program from a given Use Case definition. Follow the Average Temperature in Paradise


Objects as Function Arguments: In C program there are several methods to define arguments, and in some case even a structure can be approved as an argument.  Similarly in C+

When declaring a variable of data type pointer, use the * in front of the variable name. These variables hold a memory location (like B45CDF), not an actual value like 30 or A:

you are to create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased. How soon.....oops......he''s gone. He has left yo

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

1. The management of a company would like to determine the median annual salary of its employees.Write a pascal program that display the number of employees and their median salary

Problem: (a) A GUI can contain text-fields, buttons, and other labels. A button usually triggers an event on the GUI. Explain the different processes in registering an event

write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;