Op 2 jun. 2017 3:32 p.m. schreef "LRN" <lrn1...@gmail.com>:

On 6/2/2017 3:53 PM, bob by wrote:
> On 2017-06-02 16:23 GMT+04:00 LRN wrote:
>> On 6/2/2017 2:47 PM, bob by wrote:
>>> Can somebody here write a replacement for the standard cout, that will
be
>>> able to print strings and integers, and internally will just redirect to
>>> puts and itoa? I'm only starting with C++, I'm not sure how to do it.
>>
>> I feel compelled to cite my own first experience with C++. Specifically,
i
>> would like to mention that at the time i did not understand the
difference
>> between C and C++. It took me a while to understand the difference and
>> realize
>> that the programs i was writing were really just C programs, even though
i
>> was
>> compiling them with a C++ compiler. I stopped writing in C++ shortly
>> afterwards.
>>
>> I remembered that because you've mentioned cout and printf in the same
>> sentence.
>>
>
> Do you use datatypes like linked lists or trees or hashmaps? Can you share
> some libraries or code to work with them?
>
> I'm trying to learn C++ just because a lot of code I see is written in
C++.
> Pretty much just in case.

glib[1] is the easiest for me to name. In my experience, large-ish C
projects
tend to include their own (developed in-house or just copy-pasted from
somewhere) implementations of linked lists or trees when needed. Or use
other
utility libraries (google for "C utility library") that complement the C
standard library, which is rather bare by itself.

If you want, you can google for "C vs C++". Also - look for articles on pros
and cons of object-oriented programming in general, and C++ (as an OOP
language) in particular. That might help you understand the current
situation
around C++ better.


Be sure to check the final program code size in case of using such a
utility library vs just the C++ standard library. You might be surprised...

Also important to note c++ isn't just an object oriented language. It is so
much more. If you get through the initial syntactical and semantical
hurdles of the language and its intricacies.

Lastly I would like to emphasise that unless you are programming a
microwave or router that this whole discussion based on the size of a hello
world program is outright ridiculous. Write a complex program, and then
discuss the advantages of one language over another.

And now, on to the weekend!


[1] https://en.wikipedia.org/wiki/GLib


--
O< ascii ribbon - stop html email! - www.asciiribbon.org

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to