Thread: C or C++

  1. #31
    Registered User AcerN30's Avatar
    Join Date
    Apr 2008
    Location
    England
    Posts
    32

    Question

    Quote Originally Posted by DavidP View Post
    AcerN30, the thing that you are not understanding here is the idea of abstraction. Visual Basic abstracts all the nitty-gritty stuff from you. In other words, it hides all the deep stuff from you and gives you these simple 1-line commands to do the things you want. Abstraction can be a good thing, and at times it can be a bad thing.

    In terms of abstraction, C and C++ do not do as much abstraction for you as Visual Basic. Hence you have to write much more code in order to create windows, draw squares, and do many tasks that would take less lines of code in Visual Basic. Is this a bad thing? No. C and C++ programs perform hundreds of times more efficiently than Visual Basic programs do, and they truly give the programmer access to the system. But to be proficient in C and C++ you need to know what you are doing. You need to know at the very least know how memory/pointers work, or else you will completely fall on your face.

    You are frustrated because you cannot do the same things in one line of code in C/C++ as you could do in Visual Basic, but you are not putting forth the effort or showing any willingness to learn how things are properly supposed to be done in the C/C++ languages. Be willing to learn.

    Does this mean that there is no way to reduce the amount of lines of code that exist in a C/C++ program? No. There are several APIs that programmers use that provide nice functionality for them and some additional levels of abstraction, but you need to understand how to program in the standard C/C++ language before you start using those APIs.
    Hmm, so just trying to learn the gfx part would be pointless without learning A? then b

    As well, how would it work for a pocket pc?

    With VB, you have a template. Where is that with C?

  2. #32
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Hmm, so just trying to learn the gfx part would be pointless without learning A? then b
    Close to impossible
    With VB, you have a template. Where is that with C?
    I recommend downloading a compiler and start some tutorials

  3. #33
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    so just trying to learn the gfx part would be pointless
    ditto

    With VB, you have a template. Where is that with C?
    I haven't programmed in Visual Basic since the 8th grade (that's....10 years ago?), so I really quite honestly don't know what a VB "template" is. I assume it is some kind of pre-made project template that already has some code written for you....? Is that what you mean?
    My Website

    "Circular logic is good because it is."

  4. #34
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Maybe you could try C++. It supports OOP (ie classes), which is a bit closer to VB. Many frameworks are also written in C++.
    With C++, it is typically easier to do abstraction (IMHO) and it allows you to get closer to typical VB syntax.
    Not to mention, most games are written in C++.
    For handhelds and embedded devices and stuff, usually C is the way to go for some reason. But since C++ has its roots in C, it can do everything C can (technical: it fully supports C89, not C99), so there's no bad thing in going for C++ and learning for both your C and C++ needs.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #35
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I would say a VB template and a C++ template are quite different. They are not even playing on the same field. A C++ template is far more complex than anything you will find in VB.

    I think the common thread here is that you need to learn C/C++ prior to really trying to start on any projects using it. Small console apps will help you learn the language and then you can gradually step up. Keep in mind since C++ is very abstract as has been pointed out programming with C++ in Windows is going to require a significant amount of code as well as some rudimentary Win32 API and Win32 fundamental knowledge. Even knowing the API won't help if you don't know how a Win32 program actually works.

    Take it slow, be open and willing to learn new things, ask questions, code, code, code, code, and you will be well on your way to learning what you need to get the job done.

    C/C++ are not the only languages out there (thank goodness) but they are both extremely powerful and extremely efficient languages. The only language that tops the performance of these is pure assembly and only if its hand-tuned. C/C++ puts a lot of power in the hands of the programmer, but how, when, and where to use that power is really not that apparent and requires a lot of learning. It's my personal opinion but right now C/C++ is the most powerful language out there. I haven't come across anything else that I like nearly as much as C/C++.
    Last edited by VirtualAce; 05-03-2008 at 09:56 PM.

  6. #36
    Registered User AcerN30's Avatar
    Join Date
    Apr 2008
    Location
    England
    Posts
    32

    Question

    I just wanted to say, I did find that there was a compiler for the python language some time back.

    But it wasn't complete you couldn't run any code.

    Um, the mobile template is a image template that shows a pocket pc, with the buttons etc

    You click on these parts of the pda and it opens into the code window.

    You then type out you're code.

    I think maybe the only free alternative is C++ visual thing, whatever on the MS site with a mobile template.

    I'm viewing this board on my pocket pc.

    Windows mobile 2003

    32mb rom, 55mb ram, 266mhz processor.

    Using C or + whatever i could make it small and efficient if this were to work out...

    http://www.amazon.co.uk/gp/aw/d.html...503863Y8768839

    I could get this?
    Last edited by AcerN30; 05-04-2008 at 08:10 AM.

  7. #37
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    That would work, or any of these

    There are several free C and C++ compilers. gcc is one, and is also one of the most used. You can go with Visual Studio Express as well.

    Another option to consider is C++ Builder.

    It is my personal opinion that you should start by downloading GCC, get a good book (like from Amazon), learn the language by using those tools, and then move into Visual Studio Express, C++Builder, or one of those other things.

    You mentioned Python. Python is a completely different language, but it is also a very good language. The Python interpreter can be found here. But I wouldn't worry about Python right now if you want to focus on C or C++.
    My Website

    "Circular logic is good because it is."

  8. #38
    Registered User AcerN30's Avatar
    Join Date
    Apr 2008
    Location
    England
    Posts
    32

    Question

    Well my main reason for making a game is for the pocket pc using C.

    No one here has done this?

  9. #39
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Apparently not but that doesn't mean we can't help you if you start doing it yourself.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  10. #40
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Software and code work the same regardless of the platform. The principles remain the same albeit the implementation may differ somewhat,

  11. #41
    Registered User
    Join Date
    Apr 2008
    Posts
    15
    Looks very complicated.

    Code:
    WritePixel(x, (int)128+cos(x*DEG_TO_RAD)*100, 0xFFFFFFFF);
    is the above line a custom function or a library function?

  12. #42
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Closed. Please don't bump old threads.

Popular pages Recent additions subscribe to a feed