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
Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Given a text and K strings, task is to find out the number valid

please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B

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

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 palindromes


Develop G-code generating software Project Description: I'm presently using Slicer on a polymer jetting 3d printer. The toolpaths were thought out for FDM printers and thus a

what is the function of spanning tree in graph algorithm?

I need vsti program Project Description: Knowledge of vsti programs, and music is a plus, ex: nexus I will input the sounds I just need the interface built Skills required

Project Description: Currently seeking someone who can create me a software application (google chrome crx file_ that will auto add all shoe sizes to cart directly and if not av

How does placing some code lines between comment symbols help in debugging the code? - Placing comment symbols /* */ around a code separates some code that coder believes might