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;


                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);




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
Hello I''m new to programming, and I''m making now my 1st program. My question is how to put substr in textbox that question mark should be at the end of sentence? And 2nd question

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

What is meant by open addressing? Explain various collision resolution techniques with example

1)      Factorial (for this question just provide an answer for each part)  1.1  Debug the following program to calculate N! #include using namespace std; main()

Described multiple inheritance(virtual inheritance)? And explain its advantages and disadvantages? A: It is the procedure in which a child can be derived from more than one pare

#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string

Lennie McPherson, proprietor of Lennie''''s Bail Bonds, needs to calculate the amount due for setting the bail. Lennie requires something of value as collateral, and his fee is 10%

Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks. For Example : GetHighestLowestMarks{Student{n}, Ma

P o i n t e r d e c l a r a t i o n f o r C l a s s : M m; M * p m; / / C la ss M i s d e c l a r e d a s

Operator Overloading Fundamentals The C language uses the concept of Operator Overloading discreetly. The asterisk (*) is used as multiplication operator as well as indirect