Skip to content

How to use std::cin or getline with criterion ? #546

Description

@P4r4dis

Hello,
im trying to use std::cin or getline in my code but i have some issues like symply when std::cin or getline() is called, the program runs in a void.
there must be things I haven't understood or that I'm not doing correctly, can you help me please?
Ex:

Test(test, cin)
{
    std::string command;
    
    while (command != "exit")
    {
        std::cin >> command; // I write "exit" (without ""). ISSUE -> ctrl + C for leave
        std::cout << "result: " << command << std::endl; // line never call
    }
}

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions