Anonymous
I tried cin.get which always me take in space as a char but it messes with another function
Anonymous
The other function uses something like maxtries - wrongness to determine when the user no longer can guess anymore
Anonymous
When maxtries == wrongguesses , game over, you lose
Ибраги́м
When I used std::cin, it ignores spaces , which some of the names they are guessing has two words , so they Are strings and a space input would be needed
What u need is std::getline() How to use: #include <iostream> #include <string> int main() { using namespace std; string s; getline(cin, s); cout << s; }
Ибраги́м
سمیه Can't u see I entered 20, it stored 50
Which is the integer equivalent of '2'
🐰🐾 سمیه
سمیه Can't u see I entered 20, it stored 50
I think I gotcha.although, I don't know it, I'll use scanf to see what happens. Thanks🌷😊
Ибраги́м
I think I gotcha.although, I don't know it, I'll use scanf to see what happens. Thanks🌷😊
Ah, finally. although, I don't know it, http://www.cplusplus.com/reference/cstdio/scanf/ says hi!
Anonymous
so they Are strings and a space input would be needed What does this mean then ?
It’s a guessing game , the word thy are guessing is a string but they are actually imputing one character at a time , each time they get a character wrong , wrongguess++
Anonymous
When wrongguess == maxtries, game over
Ибраги́м
OK
Anonymous
But wronggues increases by 2 for some reason when using cin.get
Anonymous
I am assuming it taking the enter key also
🐰🐾 سمیه
Ah, finally. although, I don't know it, http://www.cplusplus.com/reference/cstdio/scanf/ says hi!
Thanks, and if you're not exhausted, I have another question 🙋
🐰🐾 سمیه
See ?
You haven't used any code to specify that it should print the output by tapping enter key, so how it is that it works that way?
🐰🐾 سمیه
I am assuming it taking the enter key also
Sorry I just noticed I'm interrupting you.
Ибраги́м
It’s a guessing game , the word thy are guessing is a string but they are actually imputing one character at a time , each time they get a character wrong , wrongguess++
OK, I get u but I don't think cin.get ignores space. int main() { char c; std::cin.get(c); std::cout << (int)c << '\n'; } When u enter space u get 32
🐰🐾 سمیه
Anonymous
Anonymous
Which makes the wrongguess increase by two instead of one
Sasuke
#notes
Ибраги́м
It works but let’s say I enter the character c it like when you press enter it like it’s taking two inputs
Nope, it's one. char c; while (cin.get(c)) { std::cout << c <<'\n'; } Type "My name is" and see the result.
Ибраги́м
I've used getchar and the book has also used it many times, what's wrong with it? 🤷‍♀
Who entered you into the dark world of C? School? Family? Evil Brother? Wicked gf/bf if any? Bad guys on the internet? Or just self-destruction ?
Dima
welcome to the dark world
Dima
follow us
Anonymous
Dima
I prefer orthodox c++, well, yes
Ибраги́м
welcome to the dark world
std::atomic bomb; launch(bomb);
Sasuke
I started learning c++ instead of c I did right?
Dima
std::atomic bomb; launch(bomb);
I LOVE post apocalypse
Dima
drop it now!
Ибраги́м
I LOVE post apocalypse
Thy didn't see launch
Ибраги́м
U prolly ded anyway
Dima
whoa
Ибраги́м
You prefer C?
You're still new to the internet and sarcasm.
🐰🐾 سمیه
welcome to the dark world
I'm happy being here 😄
Anonymous
You're still new to the internet and sarcasm.
It’s harder to tell without body language
Ибраги́м
Sasuke
Hey I think it's the best place to ask. Which resource you found best for learning c/c++
Sasuke
?
🐰🐾 سمیه
Sasuke
Ибраги́м
I haven't seen any bright world before, so I don't feel its darkness.
I still believe watching a 2-year old girl recital and 2 year old boy soccer game is less boring than C
Ибраги́м
Hey I think it's the best place to ask. Which resource you found best for learning c/c++
It's C and C++ or C, C++. Anyone that says C/C++ is a Heretic
🐰🐾 سمیه
Come on, don't dishearten me. It's growing on me.
Ибраги́м
Come on, don't dishearten me. It's growing on me.
If I wanted to do that, I would've given fake solution
Ибраги́м
For confusing the jury
Ибраги́м
Anonymous
50 slaps
🐰🐾 سمیه
🐰🐾 سمیه
Slap yourself 25 times
Mine was just 3 times 😂
Ибраги́м
Mine was just 3 times 😂
People who write C have bigger palm, more surface area
Anonymous
Lol
🐰🐾 سمیه
That's what you give a lady on women's day? 😒 Give me flowers and say nice things to us.
Ибраги́м
Lies Everywhere !
Ибраги́м
Writing C is no way to go about the day.
Ибраги́м
I mean how can I fake depression when I can write C for a day and let Psychiatrist do his/her job after the last compille
14•08
Hi
Dima
I thought why I have depression a lot