Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
CWins48087yNo. Build something with it. Doesn't have to be big, just useful enough that you yourself will use it.
-
7Raiden8757yI think C++ requires months of practice as a bare minimum. Sure we're now in a time where you put your Lego together and write "Aerospace Engineer" on LinkedIn so.. Go on xD
-
donuts236727yI started learning C++ with "Teach Yourself C++ in 24 Hours" last week... I'm on Hour 3/24 after a few detours trying to make some code better and more flexible/reuseable.
But I got lots of errors but can't figure out where wrong....
Does anyone know how to declare a function that accepts any type of parameter?
In C#, that would be an object. Seems C++ needs to define a template and I'm like WTF is that...
I think the other option is Boost... haven't had time to figure out that...
Maybe I should just follow the book... -
donuts236727y@Galrog well I just wanted something really simple actually but cant figure out how...
I want a WriteLine function rather than appending << "\n" to all the cout's
cout can take anything but dunno how it does it or how to make mine work -
donuts236727y@Galrog lol WTF... you can pass void as an argument... wow....
Well that would've save me a few hours...
How advanced is this knowledge? -
@billgates to answer your question as to how cout can take anything:
Multiple overloaded operator << for the std::ostream type -
@Galrog well, yes, but the templates aren't the essential part in that ^^ you could just as well omit them
And I don't see where C++ is being an asshole there, seems like a pretty smart move to me actually -
donuts236727y@Galrog oh finally read the description... So need to specify the type and cast... Otherwise just prints the address...
Ok... Guess no more detours... I'll just gone the book first... -
dauie377yLearn how to use vectors properly, the algo library, and brush up on your basic c knowledge imo. I agree that you should do a project with c++. I have a project called fillit that I do in every language I learn. Its a tetramino compressor. Https://github.com/dauie/fillit
-
ddephor44467yvoid pointer are usually a bad idea, they are only usefull if you want to directly access the memory content and need no information about the original type.
If you need to cast back into a real datatype you will very likely shoot yourself in the foot or even blow away the whole leg.
As already explained, iostreams use overloaded operators, and therefore it can handle many types, but not all possible types correctly.
Started learning C++ today. Do you think I'll be able to put it on my CV by Friday?
undefined