Anonymous
WTF?
Morgan
Hey guys
Anonymous
is cin a bad cpp practice ?
Anonymous
googled but found 0 things related to my issue
Anonymous
No. It's the standard input stream why would it be bad
Anonymous
No. It's the standard input stream why would it be bad
opened the input stream and left it open
Anonymous
is cin a bad cpp practice ?
I mean cin >> var ?
Anonymous
opened the input stream and left it open
and I don't even know why nor I can think in anything possible for that
Anonymous
struggling to make small e.g code some code just for learning to work
Anonymous
Anonymous
I've tried it out of qt creator and still having some weird issues
Anonymous
like
Anonymous
Anonymous
if I'll remove the first cout << endl; it will print "Enter the first name: Enter the last name" and then will open the input stream
Anonymous
but the thing , why
Ǝlmar
Write a program that prints a table of all the Roman-numeral equivalents of the decimal numbers in the range 1 to 100 in C
Ǝlmar
how can I complete this task?
Anonymous
It's not
well , do you have any thoughts about this
Anonymous
Anonymous
but
Anonymous
nvm , I'll watch the vids before
Mat
The first cin should not let the second output go out🤔🤔🤔
Mat
There's something strange here
Mat
Guys, what's clang variant for cpp?
Anonymous
There's something strange here
there is endl here before the cin and even without endl it still give the same
Morgan
Waaah this is not normal
Morgan
Like is there a question for this?
Anonymous
The first cin should not let the second output go out🤔🤔🤔
yeah , in the second e.g , but idk how it did it nor why iirc it was used to get the input and then it add a new line to stdout after reading the input
Mat
I'll try to recreate this
Anonymous
Like is there a question for this?
actually I don't think so , nothing about leaving opened input stream in cpp for cin or something like skipping the first cin and stuff like it
Mat
Mat
Working as expected
Anonymous
this doesn't tho
Anonymous
and didn't use std to avoid , yk , that sort of errors with common names conflitcs
Mat
Can you send raw code?
Mat
From a phone isn't too easy copy something
Anonymous
Can you send raw code?
file or copypast with ` ?
Anonymous
#include <iostream> int main(void){ std::cout << "Enter length and width"; int length, width; std::cin>>length; std::cin>>width; std::cout << "length is: " << length << "and width is: " << width; return 0; }
Anonymous
oh , yes this should work fine , my fault , didn't include string lib
Anonymous
but
Anonymous
tf
Anonymous
in this video , the instructor didn't include the string library and it worked
Anonymous
even with including string .. same
Anonymous
even with including string .. same
but worked fine out of qtcreator
Mat
Anonymous
Any professional competitive programming here?
Mat
Termux cutted last line. It was how it should be
Anonymous
that yeah worked fine out of qtcreator even the strings worked
Anonymous
even when added couts between them , worked as expected
Anonymous
ig I just will rewrite it , if it didn't work gonna close , and use vsc
Anonymous
well , now another simialirly odd thing
Anonymous
is this normal to be default behavior ?
Anonymous
Hi everyone
Anonymous
Is there anyone who understands assembly programming language🙋‍♂️
Boet
is this normal to be default behavior ?
If you don't enter anything for the second string, yes
BinaryByter
is this normal to be default behavior ?
try another terminal emulatorr
Anonymous
is this normal to be default behavior ?
I'd expect such a behavior if I did 2 cin after each others without something to separate them but with cout in between , didn't really expect it
Anonymous
try another terminal emulatorr
in qtcreator console it doesn't close the first stream tho in gnome terminal runs same as this as well
Anonymous
Anonymous
Cin and cout are two different streams
yeah but I mean its bit odd to skip over and feed the secondary cin
BinaryByter
7.3.0-27
mhh. should work
BinaryByter
do you maybe add a whitespace after entering the string?
BinaryByter
or does it have whitespace?
Anonymous
what should be in the data segment in order to allow the user to key in data from the keyboard
BinaryByter
YES IT DOES
Anonymous
The couts dont have an endl tho
I mean why it can't handle the space as a space not as \n
BinaryByter
what should be in the data segment in order to allow the user to key in data from the keyboard
data segment of what? if you want something like scanf, use sys_read with 1 as the file descriptor
Prometheus