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

Help: error code: missing function header (old-style formal list?)

P: 1
hello can anyone help me im making a project ive been for hours on sites looking for help: basically, im making site which reads a password, allows access if it is correct: it will also after 3 attemps stop and close the program. Can anyone help me this is what i have done so far. If anyone could help i would be sincerly grateful, thanks please can someone help ? even if you point out pointers this would be great !

Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <stdio.h>
  3.  
  4. #include <stdlib.h>
  5.  
  6. #include <conio.h>
  7.  
  8. #include <iostream.h>
  9.  
  10. char *pass ="1234";
  11.  
  12. int attempts;
  13.  
  14. char userpass[80];
  15.  
  16.  
  17. main();
  18.  
  19. {
  20.  
  21. //cout << "Please Enter Your Password: ";
  22.  
  23. //cin.getline(userpass, 80, '\n' );
  24.  
  25. attemps= 0;
  26.  
  27. while (*userpass != *pass && attemps >=3); 
  28.  
  29. }
  30.  
  31. {
  32.  
  33. cout << "Please Enter your password:";
  34.  
  35. cin.getline(userpass, 80, '\n' );
  36.  
  37.     attempts++;
  38.     // adds one to the attempt
  39.  
  40. do puts ("You have been locked out the system");
  41. // when attempts becomes three you are locked out of the system;
  42.  
  43. //{
  44.  
  45. cout << "Access Denied";
  46.  
  47. // acess denied is displayed when the user enters the incorrect password
  48.  
  49.  
  50. cin.getline( userpass, 80 , '\n' );
  51.  
  52. //}
  53.  
  54.  
  55. puts ("Access Granted"); 
  56.  
  57.  
  58.  
  59. getch();
  60.  
  61.  
  62. }
  63.  
  64.  
Mar 9 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
if you have a missing function header it is probably <conio.h> which is none standard . Remove the #include and change getch() to getchar().
Mar 9 '07 #2

P: 93
if you have a missing function header it is probably <conio.h> which is none standard . Remove the #include and change getch() to getchar().

The semicolon present after the main() is not supposed to be there.
Mar 11 '07 #3

Post your reply

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