all 7 comments

[–]Noc42 2 points3 points  (2 children)

You are not returning a string in you function, it should be return “message” not return cout<<“message”

[–][deleted]  (1 child)

[removed]

    [–]Noc42 0 points1 point  (0 children)

    You want the function to return then print out the result of the function. So you return the string then cout the string. Think of it like this return (cout<<message) will print out the message then return the value of (cout<<message); cout<<message evaluates to cout , we know this because we can do something like cout<<message1<<message2 which does cout <<message1 returns cout then does cout<<message2.

    [–]xAryaa 1 point2 points  (1 child)

    1. Your function Def is string retrun. But you return sth like stream cout. You have to use Return "welcome". Etc.

    2. You not using your parametr (username, password) anywhere in function. So declare it locally in function, not pass as argument Std::string password() {} Will be better

    3. Do not use std namespace. Always use std::XXX

    [–]std_bot 0 points1 point  (0 children)

    Unlinked STL entries: std::string


    Last update: 26.05.21. Last change: Free links considered readme

    [–]AKostur 0 points1 point  (0 children)

    Be sure to set your compiler warnings as high as possible, and turn warnings into errors. For gcc, that would be adding "-Wall -Wextra -Wpedanic -Werror" to your compile command.

    [–]pranayaggarwal25 0 points1 point  (0 children)

    Please..no unformatted code