By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,603 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,603 IT Pros & Developers. It's quick & easy.

help me

P: 2
please give me an example of program that sorts this struct memeber
struct new
{
int id;
};
new type;
void main()
{
cout<<"how many id's\n";
cin>>n;
for(int i=0;i<=n-1;i++)
{
cout<<"enter id\n";
cin>>type.id;
}
fill out put too please
Nov 16 '06 #1
Share this Question
Share on Google+
1 Reply


sivadhas2006
100+
P: 142
Hi,

Your program has some errors.


I corrected the errors.
Expand|Select|Wrap|Line Numbers
  1. struct structEmp
  2. {
  3.    int id;
  4. };
  5. structEmp type;
  6.  
  7. #include <iostream.h>
  8. void main()
  9. {
  10.    int
  11.       n = 0;
  12.  
  13.    cout<<"how many id's\n";
  14.    cin>>n;
  15.    for(int i=0;i<=n-1;i++)
  16.    {
  17.       cout<<"enter id\n";
  18.       cin>>type.id;
  19.    }
  20. }
  21.  
Regards,
M.Sivadhas.
Nov 16 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.