Anonymous
Did you get it
Anonymous
It is explained there
Anonymous
But it's a bad code
Anonymous
yeah but what does that mean?
Anonymous
explain it
Anonymous
I can't explain it better than it explained there
Anonymous
what is lifetime?
Anonymous
and extending the lifetime?
Anonymous
what is lifetime?
Well Lifetime is a period of time that an object exists
Anonymous
explain in that reference
Anonymous
https://www.learncpp.com/cpp-tutorial/74a-returning-values-by-value-reference-and-address/
Anonymous
pic
Anonymous
What does "Assume the input stream cin contains 12 17.3 -19" mean?
Anonymous
7th page
Wim
Context please
Why do you need context, he's basically just saying the input wil be this
Anonymous
yess
Ludovic 'Archivist'
Why do you need context, he's basically just saying the input wil be this
Because half of a sentense doesn't have a correct meaning
Ludovic 'Archivist'
And the sentense was obviously truncated
Anonymous
Can you now explain?
Ludovic 'Archivist'
Can you now explain?
Read the whole sentense
Anonymous
what ?
Anonymous
I have already provided the resource.
Ludovic 'Archivist'
Anonymous
what to read
Ludovic 'Archivist'
what to read
Assume the input stream cin contains the data:1217.3-19 Then: int A, B; double X; cin >> A;// A <--- 12 cin >> X;// X <--- 17.3 cin >> B;// B <--- -19
Anonymous
what does contain mean?
Anonymous
what does "cin contain" mean?
Anonymous
cin is an object
Ludovic 'Archivist'
what does contain mean?
To be in something. Use a common English dictionary for this type of question
Anonymous
excuse me
Dima
this is some ultra retarded assignment. probably it means “what input given via cin contains”
Ludovic 'Archivist'
cin is an object
cin is an object of class istream for input stream
Anonymous
yes
Ludovic 'Archivist'
And the stream contains some text
Anonymous
I know that it means taking input
Anonymous
Ludovic 'Archivist'
That what confuses me.
https://en.m.wikipedia.org/wiki/Stream_(computing)
Anonymous
stream is a channel bw a process and the input/output device
Anonymous
what is cin then
Ludovic 'Archivist'
what is cin then
The standard input stream
Anonymous
and what is stdin?
Dima
Doh.
Anonymous
cin is stdin?
Ludovic 'Archivist'
and what is stdin?
The very same as a C FILE type
I_Interface
cin is stdin?
It's from C, isn't it ?
Anonymous
I can't get what people are saying here.
I_Interface
I can't get what people are saying here.
Too many questions from you, man
Anonymous
Ludovic 'Archivist'
I can't get what people are saying here.
stdin is a FILE that is the same as the standard input stream (yes, a stream and a file are the same in programming), cin is the representation of that file as a stream, stdin is the same for the C programming language
Anonymous
cin represents stdin?
Ludovic 'Archivist'
cin represents stdin?
Actually they are both representing the same file, not one other
Ludovic 'Archivist'
stdin gets characters until pressing Enter ?
That depends on your shell or on what inputs the data
Anonymous
and does FILE represent a stream from a process to a device?
Ludovic 'Archivist'
Stream or not
Anonymous
so it is not stream
Anonymous
FILE is not stream?
Ludovic 'Archivist'
so it is not stream
Streams are files
Anonymous
ok
Ludovic 'Archivist'
Files are not streams (but can be accessed by streams)
Anonymous
So, Files(console, txt file) can be accessed using streams?
Dima
doh
Anonymous
PROCESS———channel/stream———--FILE
Ludovic 'Archivist'
Compot is made of fruits, fruits are not made of compot, you can make a compot out of any fruit
Dima
COMPOT
Dima
Oh yes
Ludovic 'Archivist'
Streams are made of files, files are not made of streams, you can make a stream of any file
Dima
winapi comport
Anonymous
Is this the correct representation? PROCESS———channel/stream———--FILE
Anonymous
and PROCESS is using cin to get the content of FILE?
Ludovic 'Archivist'
Is this the correct representation? PROCESS———channel/stream———--FILE
C++ : stream ^ | v C++ Library : file descriptor ^ | userspace (process) ---+++--- | kernel space (system) v OS : inode
Anonymous
Aaah where is our CPP program that is getting the data from file
Anonymous
😢
Anonymous
and where is FILE?
Anonymous
What is wrong in my implementation? PROCESS———channel/stream———--FILE
Anonymous
PROCESS is cpp program.