Adblock breaks this site

Fun exam questions

Discussion in 'Programming General' started by Sythe, Apr 25, 2010.

  1. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    I hope you're joking.
     
  2. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    Nope I am not joking. C is surpassed by most other languages nowadays mainly because of lower productivity.
     
  3. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    Most operating systems including Windows NT and the Linux kernel are still written entirely in C, with some higher-level components written in C++.
     
  4. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    That is true. However, considering the whole world of programming, operating systems play a very small role. Unless you have to program specifically in C for some reason, if there are alternatives, people would not choose C.

    Same thing applies for Assembly language. Even though it is still extremely crucial in hardware design and reverse engineering, it cannot be considered popular or worthy to learn.
     
  5. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    Ever since Visual Studio .NET, the only way to write native Windows applications in Visual Studio is through C and C++. C is marginally faster than C++ (objects have an overhead), so unless you're using something like MFC, there is no reason to not use C.

    I used to use the MFC AppWizard for my autos, but ever since discovering how much nicer plain-old Windows API is, I now use C instead.
     
  6. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    Being plain and simple boosts speed of programs written in C. But in real world, run-time speed does not determine everything. Beside run-time speed, there is also speed of coding, speed of troubleshooting, speed of getting general support, speed of learning the language... Yea I am talking about it in a business perspective rather than strictly coding perspective. If you need to program for money or a living, C is not the best because most of the time, programming involving C requires much more time and effort for very simple tasks in general applications and time is money so you lose money here. :)
     
  7. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    Ah, but, when dealing with the Windows API, the only difference between C and C++ code is one that has to do with the language itself, not the API:

    The latter language can have variable declarations anywhere, whereas the former must have all variables declared at the beginning of the block indicating their scope. Everything to do with Windows programming; the message loop, the API functions, resources, etc. are just as easily accessible through either language.

    Unless you're using or creating an object, is there really any reason to not use C over C++?
     
  8. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    I am afraid you are going off-topic here. I only wanted to point out not to waste too much time on C considering many other languages. Of course, one can learn C and have fun with it and even use it to make money if wanted to. I never said you must absolutely not learn or use it. When I said C became quite obsolete, I meant its popularity had gone down because of many reasons. If you can zoom out on your thinking, consider many other languages beside C, you can clearly see what I am trying to say. Just pointing out the fact in real world, not just my own opinion. :)
     
  9. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    I do use other languages :)
    I just like C more :p
     
  10. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    I also like C, remember Turbo C or Borland C in the old day. It was so fast and so simple. :D When I was forced to learn other languages simply because other people started to leave C, I was so disappointed.
     
  11. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    What languages do you use these days? :)
     
  12. blahbleh

    blahbleh Active Member

    Joined:
    Nov 7, 2010
    Posts:
    179
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    I mainly use PHP, Java and C# these days, nothing so cool but generates cash for me :D . What do you use? Do you need to do programming being a moderator?
     
  13. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    Fun exam questions

    Not usually.

    I use C, C++ and Java, but I'm still in University so I haven't seen what professional projects look like.
     
  14. Sythe

    Sythe Join our discord

    test

    Administrator Village Drunk

    Joined:
    Apr 21, 2005
    Posts:
    8,071
    Referrals:
    467
    Sythe Gold:
    5,281
    Discord Unique ID:
    742989175824842802
    Discord Username:
    Sythe
    Dolan Duck Dolan Trump Supporting Business ???
    Poképedia
    Clefairy Jigglypuff
    Who did this to my freakin' car!
    Hell yeah boooi
    Tier 3 Prizebox Toast Wallet User
    I'm LAAAAAAAME Rust Player Mewtwo Mew Live Free or Die Poké Prizebox (42) Dat Boi
    Fun exam questions

    http://langpop.com/

    Most compilers, operating systems, applications and video games are still written in C/C++.

    I would venture as far as to say if you don't know c++ you are unlikely to get a programming job in most cases.
     
  15. runeowner

    runeowner Forum Addict
    Banned

    Joined:
    Jan 23, 2007
    Posts:
    456
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    could u do a java exam? :)
     
  16. waasje

    waasje Member

    Joined:
    Sep 2, 2008
    Posts:
    49
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    Looks nice, any change you could make a tutorial on how to make a simple 3d game in c++ using win32 api? I love to see a tutorial about that :D
     
  17. Jenka

    Jenka Active Member

    Joined:
    Mar 1, 2011
    Posts:
    170
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    im going to have to do some major studying if i ever decide to do this lol
     
  18. super_

    super_ Member

    Joined:
    Dec 20, 2008
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    did it all mentally while doing homework so it may be wrong. haven't used C in a while.
    1) print hello world
    2) infinitely
    3) recurse infinitely
    4) it creates infinitely many processes
    5) cause a segmentation fault
    6) char a[10]; int b = 5; a = 5;
    ? 7) void * (** foo)(void); yes
    ? 8) 9
    ? 9) compiler-dependent. depends on ambiguous operator precedence of postfix and prefix operators ++ and +
     
  19. Shenzuu

    Shenzuu Active Member

    Joined:
    Nov 9, 2008
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    to say C is obsolete is like saying language is an obsolete form of communication.

    it is what drives the entire online world, essentially.
     
  20. Blondi

    Blondi Guru
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    1,458
    Referrals:
    0
    Sythe Gold:
    0
    Fun exam questions

    Q1: Yes
    Q2: Infinitely.
    Q3: Infinite loop
    Q4: Fork bomb
    Q5: The if statement is just a regular statement in disguise. After this, the code block prints out the value assigned to *'z' (8).
    Q6: Sets the 5th index of a[] to 5.
    Q7: It's a function pointer to another function pointer type.
    Q8: 011 (9)
    Q9: Either 2 or 3 depending on the compiler.

    ;)
     
< Starting C++ | Anyone do Applescript? >


 
 
Adblock breaks this site