#What is this phrase doing at the start of my function

48 messages · Page 1 of 1 (latest)

charred monolith
#

This is the phrase: std::ostream&

past dockBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

charred monolith
#

I searched it online but understood nothing, haven't looked at cppreference though, will give it a try. Thanks mate

rain galleon
#

do you know what cout is?

charred monolith
#

I read through it, still, what is a stream I cannot understand

rain galleon
#

well cout is a type of ostream

charred monolith
#

That's weird, I can't see the relation

#

Doesn't cout just print out stuff in the terminal?

charred monolith
#

Aalright just a sec

charred monolith
rain galleon
#

that's not the main way I would describe them, but, sure?

#

lots of things can be variables, so that doesn't say much

charred monolith
#

But what type of data do they hold, can one stream hold and integer and a character?

#

And is that definition not used for arrays also

#

Or if I had to sum up my question, what is the difference between a stream and an array?

rain galleon
#

I am feeling like it's not likely possible for you have to actually read that whole chapter in the time since I posted the link

#

maybe read it first

charred monolith
#

Alright

#

I read the definition

#

And had a lot of questions

rain galleon
#

well then you may need to start over reading from chapter 1

#

that's chapter 23

charred monolith
#

But I can write programs in cpp, I should know all the basics and a bit more

#

I will scan through the definition again a couple of times, see if I can make sense of it

#

Alright, so from what I can see the difference is that streams can hold on to data while the device is getting ready to accept it

#

How true is that?

past dockBOT
#

@charred monolith Has your question been resolved? If so, run !solved :)

rain galleon
#

it's still not how I would describe a stream

#

streams are basically for io

#

hence the title of chapter 23

charred monolith
#

I read through it

rain galleon
charred monolith
#

But they are what

#

A function? A variable?

rain galleon
#

they are classes

#

as such yes they have functions

#

as such yes you can make variables out of them

#

like most classes

charred monolith
#

So ostream and istream are classes?

#

Or streams are classes

#

Or are istream and ostream streams

rain galleon
#

yes, yes and yes, respectively

charred monolith
#

Alright thanks, I'll keep reading

charred monolith
#

!solved