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

Error messages on compilation

P: 1
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. #include<stdio.h>
  5. class pass {
  6.    private:
  7.       char ch[30];
  8.       int len;
  9.    public: 
  10.       char get();
  11.       void ask(char);
  12. };
  13. char pass::get()
  14. {
  15.    cout<<"enter the character: ";
  16.    gets(ch);
  17.    len=strlen(ch);
  18.    return ch[len];
  19. }
  20.  
  21. void pass::ask_(ch[])
  22. {
  23.    cout<<ch;
  24. }
  25.  
  26. void main()
  27. {
  28.    clrscr();
  29.    char y[30];
  30.    pass hi;
  31.    y=hi.get();
  32.    hi.ask(y);
  33.    getch();
  34. }
  35.  
CAN U TELL ME HOW TO GET RID OF THE ERRORS OF THIS PROG
Feb 23 '07 #1
Share this Question
Share on Google+
1 Reply


sicarie
Expert Mod 2.5K+
P: 4,677
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. #include<stdio.h>
  5. class pass {
  6. private:char ch[30];
  7. int len;
  8. public: char get();
  9. void ask(char);
  10. };
  11. char pass::get()
  12. {
  13. cout<<"enter the character: ";
  14. gets(ch);
  15. len=strlen(ch);
  16. return ch[len];
  17. }
  18. void pass::ask_(ch[])
  19. { cout<<ch;
  20. }
  21. void main()
  22. {
  23. clrscr();
  24. char y[30];
  25. pass hi;
  26. y=hi.get();
  27. hi.ask(y);
  28. getch();
  29. }
  30.  
CAN U TELL ME HOW TO GET RID OF THE ERRORS OF THIS PROG
Garden - please do not double-post.

What error messages are you getting from that?
Feb 23 '07 #2

Post your reply

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