(Topic ID: 309660)

Son needs help w/"C" Programming assignment. Tutor needed (fast)

By iamabearsfan

2 years ago


Topic Heartbeat

Topic Stats

You

Linked Games

No games have been linked to this topic.

    Topic Gallery

    View topic image gallery

    CBook (resized).jpg
    2022-02-1721.37.223380997622096685046.jpg
    20220217_202134 (resized).jpg
    popular-programming-languages.gif
    Screen Shot 2022-02-08 at 10.24.00 AM (resized).png

    You're currently viewing posts by Pinsider DumbAss.
    Click here to go back to viewing the entire thread.

    #29 2 years ago
    Quoted from Zitt:

    C# is basically C which is basically C++.
    And yes; C, C++ is used everywhere. I know someone is going to say C# isn't C... but you can argue all you like... the syntax of the language is identical. The only difference is C# is a little newer with more layers; but the language syntax is the same.

    <disclaimer>I have not programmed in C/C++ for a long time (about a decade now) so this information may be out of date.</disclaimer>

    The below is not commentary on the language constructs or language syntax.

    C is not object oriented. There is no implicit "this" object. That's one of the best features of C++. The ability to group instance variables - i.e. member variables. Instantiating an object allows multiple instances with their own context. You can, of course, achieve the same thing in C by passing a struct (pointer) around. C++ also implicitly supports polymorphism and inheritance. You can implement these in C but why bother when the C++ compiler does this natively in the language. The C++ compiler is also much more type safe. Standard C typecasting is inherently dangerous. C++ typecasting is much safer (with the exception of reinterpret_cast which is essentially a C typecast).

    C also does not have overloading. Another useful feature to make code more readable.

    C# also has one big fundamental difference from C/C++. It requires a supporting runtime (the CLR). C/C++ compiles to native instructions of the target platform and interfaces with facilities provided by the operating system. C# compiles to intermediate language (IL) and the runtime interfaces with facilities provided by the operating system. The IL is translated to native instructions by a JIT (just in time) compiler. I assume it is possible to produce a binary that is pre-compiled to native instructions but that binary still requires the runtime. The C# runtime also provides garbage collection and takes care of memory management. With C/C++ you are on your own. Leak memory (or address space) all you want.

    Gosh that brings back memories of years spent in a development environment and debuggers.

    You're currently viewing posts by Pinsider DumbAss.
    Click here to go back to viewing the entire thread.

    Reply

    Wanna join the discussion? Please sign in to reply to this topic.

    Hey there! Welcome to Pinside!

    Donate to Pinside

    Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


    This page was printed from https://pinside.com/pinball/forum/topic/son-needs-help-w-c-programming-assignment-tutor-needed-fast?tu=DumbAss and we tried optimising it for printing. Some page elements may have been deliberately hidden.

    Scan the QR code on the left to jump to the URL this document was printed from.