Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    need help in c++


    akademiks
     Share

    Recommended Posts

    #include <iostream>

    #include <windows.h>

    #include <winable.h>

     

    using namespace std;

     

    int main (void)

    {

     

    string password;

    cout << "Enter password to acess program";

    getline (cin, password);

     

    if (password == "******")

    {

     

    string answer;

    system("CLS");

    cout << "*******";

    Sleep (2000)

    cout << "\ ********?/n";

    getline (cin, answer);

     

    if(answer == "no")

     

    {

     

    cout << "xD";

    }

    else

    {

    cout << "Im glad to hear that!";

    }

    {

    else

    }

     

    BlockInput(true);

    system("CLS");

    cout << "Incorrect password, now closing!";

    Sleep(3000)

    return 0;

    }

    system("PAUSE>nul");

    return 0;

    }

     

     

    __________________________________________

     

    hey guys i just started to learn c++ and tried to code some programms, but on this one i get an error (cout << "\ ********?/n";)

    and idk how to fix it :S... hope one of u can help me Oo

    Link to comment
    Share on other sites

    cout << "\ ********?/n";

     

    to

     

    cout << "********?/n";

     

     

    but here is an easier way.

     

    #include <iostream>
    #include <windows.h>
    
    char buffer[50];
    int main()
    {
     printf("Enter the password: ");
    	 scanf("%s", &buffer);
    
    	 if(buffer && buffer == "yourpassword")
    	 {
    			printf("\nLogged in.\n");
    	 }
    	 else
    	 {
    			 printf("\nWrong Password.\n");
    	  }
    return 0;
    }

    Edited by silex
    Link to comment
    Share on other sites

    cout << "\ ********?/n";

     

    to

     

    cout << "********?/n";

     

     

    but here is an easier way.

     

    #include <iostream>
    #include <windows.h>
    
    char buffer[50];
    int main()
    {
     printf("Enter the password: ");
    	 scanf("%s", &buffer);
    
    	 if(buffer && buffer == "yourpassword")
    	 {
    			printf("\nLogged in.\n");
    	 }
    	 else
    	 {
    			 printf("\nWrong Password.\n");
    	  }
    return 0;
    }

     

    thanks :]

    Link to comment
    Share on other sites

    you forgot to add an ; after Sleep (2000) xD next time check your code twice or more times ! or try to search in google for the error messages.

    Link to comment
    Share on other sites

    you forgot to add an ; after Sleep (2000) xD next time check your code twice or more times ! or try to search in google for the error messages.

    thanks again^^ and sry i just started with c++ and it was/is my 2nd programms :S

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...