Thread: I have some questions :(

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    35

    Unhappy I have some questions :(

    Q1: whats the easiest way to get your head around c?
    Because no matter how hard I try and understand it just keeps confuses me

    Q2: whats the difference between c and c++?
    Q3: whats the difference between borland complier and dev complier?

    Im asking this becasue Ive been given an scenario for an assignment and I feel lost becasue I cant do it due to the fact it confuses me becasue tutorials dont explain clear enough. It has to be in on the 11th feb and I have to not only write the program but do the paperwork as well. I know boards like these arent meant to help but I need some sort of guidance, everyone in my class is going to leave this assignment to the last minute and I dont want to do that, the lecture did give out handouts but its for borland and I cant install that plus I dont like it so Im using dev hence why I asked the difference question and again like everything else the handouts confuse me, I dont want to corner him outside of class because I'l feel weak and I dont want to shoot him 25 million questions becasue he has other students to help.

    I feel like Im stuck between a rock and a hard place

    Thanks for any help, GRG

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I have never used c++ but I would guess that the "object oriented" paradigm would be a central concept in the answer to #2. Unfortunately, if you don't know any other languages and are this new to C, I think it will be very hard or impossible for you to get much of a grasp on what object oriented could mean. If you have to write a paper on the topic anyway, the goal cannot really be more than to familiarize yourself with the topic as best you can -- which to repeat I am sure that is about object orientedness in question #2.

    Regarding question #1: I learned perl before I came to C which I think gave me a perspective that you might not have if the first language you learned required you to do so much "low level" work with memory allocation and variables (ie. pointers). That also helped to reveal how very very clever the referencing system is and why C is supposed to be the "fastest" language above assembly. But when you are first learning it most people would probably admit it seems ridiculous to go to such lengths manipulating the information in a computer's RAM! So I would say the best thing to do is really focus on the pointer issue, especially the difference between a variable which is a copy of part of another variable, and a variable which points to a section of an existing variable. Eg.
    Code:
    x=y;
    *x=&y;
    In both cases, x and y are the same, but in the first case this is a value which exists as two seperate values in two different places, so now
    Code:
    x+=2;
    *x+=2;
    In the first case, x=4 and y=2, while in the second x and y = 4. This has some inherently vectorish dimension (a vector is a mathematical transformation performed on multiple values simultaneously), although really it's not a vector. This might seem slightly esoteric or irrelevent BUT, while I'm not sure if C was the very first language to do this (it could have been a necessity?) I am sure it's very central to it's structure, evolution, and use (value). C is just tricks with bytes -- get it? Really true.
    Last edited by MK27; 01-31-2009 at 04:48 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by MK27 View Post
    I have never used c++ but I would guess that the "object oriented" paradigm would be a central concept in the answer to #2
    No, not quite.
    C++ is multi-paradigm; programmers program not with one paradigm, but several.
    OOP and Generic, among them, as well as Imperial or something, I think?
    Anyway, you can think of C++ as a more modern C. For specifics, there are plenty of pages out there that explains it all. Too much to list.
    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.

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    Q1: whats the easiest way to get your head around c?
    ...
    Im asking this becasue Ive been given an scenario for an assignment and I feel lost becasue I cant do it due to the fact it confuses me becasue tutorials dont explain clear enough. It has to be in on the 11th feb and I have to not only write the program but do the paperwork as well.
    ..
    You cannot master* C in 11 days, whatever approach you take. You can still learn the basics depending on your current knowledge and depending on the type of project you have to complete. You can find a lot of operational code on the net, so you could simply assemble those pieces into a functional program, without understanding all the implementation details (but you have to be able to justify your choices). As for the development environment, use whatever you can install, the differences are irrelevant at this point (except that you must be operational quickly with it, i.e. be able to edit files, modify them and compile the project and test your code).

    *in the sense: to write reasonably complex programs using all C facilities

    PS: several of your questions are answered in the FAQ board
    Last edited by root4; 01-31-2009 at 04:06 PM.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    It's always just possible that C programming is not for you. There's no shame in that. The soft sciences, like sociology, are not for me.

    We may be able to help if you can tell us what you can't "wrap your head around." Maybe someone can explain it in some way that makes more sense.

  6. #6
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by Elysia View Post
    No, not quite.
    C++ is multi-paradigm; programmers program not with one paradigm, but several.
    OOP and Generic, among them, as well as Imperial or something, I think?
    Anyway, you can think of C++ as a more modern C. For specifics, there are plenty of pages out there that explains it all. Too much to list.
    "Imperative" is what you're looking for. "Procedural" is another term for it.

    Which compiler you use shouldn't make much difference at this point.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Learning a first programming language isn't very easy - the main reason being that you also have to learn PROGRAMMING/SOFTWARE DEVELOPMENT - at least at the basic level.

    Learnig programming is a bit like learning to drive, whilst learning a language is like getting used to driving a particular model of car - there are differences, especially if we were to compare, say, a high-performance sports-car with a big truck - they don't behave the same way. But the basic driving skills you need for one is the same that you use for the other. So programming skill in general is the basic learning, and if you understand well how to write programs in language X, you can most likely do reasonably well in languages Y and Z as well.

    C, and to a large extent C++, are not great beginner languages either - it is far too easy to make simple mistakes and they go unnoticed for a long time - which is not a good idea when learning, because discovering what is wrong when the problem and the cause of the problem are far apart makes it much harder. [Elysia will say that C++ is much better, which I agree that it is to some extent, but it is not a SAFE language by any reasonable meaning of that term - particularly not when using the classic C features that are still part of the C++ language].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    In my head happyclown's Avatar
    Join Date
    Dec 2008
    Location
    In my head
    Posts
    391
    Quote Originally Posted by geekrockergal View Post

    Q2: whats the difference between c and c++?
    Here's a list of differences, from the FAQ.

    http://faq.cprogramming.com/cgi-bin/...&id=1043284376

    Q3: whats the difference between borland complier and dev complier?
    I have found Dev C++ to be much easier to use. It compiles the program, and makes an .exe file in the same directory as the source file. Nice and simple.

    Borland creates 3 or 4 folders, then puts different files in different folders. It can be confusing for a newbie.

    EDIT: And I've been self-learning C for about 2 months. All you really need is to know the keywords, and the syntax, and use logic when writing your programs, and it's amazing what you can achieve with C.
    Last edited by happyclown; 01-31-2009 at 07:51 PM.
    OS: Linux Mint 13(Maya) LTS 64 bit.

  9. #9
    In my head happyclown's Avatar
    Join Date
    Dec 2008
    Location
    In my head
    Posts
    391
    Quote Originally Posted by MK27 View Post
    I have never used c++...
    That came as a surprise.

    You are good with C, so if C++ does some things better than C, why don't you give C++ a go?

    Best of both worlds.
    OS: Linux Mint 13(Maya) LTS 64 bit.

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by geekrockergal View Post
    Q1: whats the easiest way to get your head around c?
    Because no matter how hard I try and understand it just keeps confuses me

    Q2: whats the difference between c and c++?
    Q3: whats the difference between borland complier and dev complier?

    Im asking this becasue Ive been given an scenario for an assignment and I feel lost becasue I cant do it due to the fact it confuses me becasue tutorials dont explain clear enough. It has to be in on the 11th feb and I have to not only write the program but do the paperwork as well. I know boards like these arent meant to help but I need some sort of guidance, everyone in my class is going to leave this assignment to the last minute and I dont want to do that, the lecture did give out handouts but its for borland and I cant install that plus I dont like it so Im using dev hence why I asked the difference question and again like everything else the handouts confuse me, I dont want to corner him outside of class because I'l feel weak and I dont want to shoot him 25 million questions becasue he has other students to help.

    I feel like Im stuck between a rock and a hard place

    Thanks for any help, GRG
    If your teacher is giving your class further info to do your work, which is specific to using Borland, then you should switch to the borland compiler and ide. D'uh!

    Borland IDE has hundreds of examples you can bring up, including nearly any key word in C, just by pressing crtl + f1, an index to every key word in C/C++ is shown, with a search available including an example in code, so I don't believe you know what you're talking about.

    I still write short utility and puzzle programs with Borland's Turbo C/C++, so your misstatements of facts are quite obvious to me.

    you posted: "I know boards like these arent meant to help but I need some sort of guidance" ... .

    Which is also completely wrong - we help hundreds of students and others, with C programming problems. How can you look at this forum, which is filled with help requests and helpful answers, and write that?

  11. #11
    Registered User
    Join Date
    Jan 2009
    Posts
    35
    Quote Originally Posted by Adak View Post
    If your teacher is giving your class further info to do your work, which is specific to using Borland, then you should switch to the borland compiler and ide. D'uh!

    Borland IDE has hundreds of examples you can bring up, including nearly any key word in C, just by pressing crtl + f1, an index to every key word in C/C++ is shown, with a search available including an example in code, so I don't believe you know what you're talking about.

    I still write short utility and puzzle programs with Borland's Turbo C/C++, so your misstatements of facts are quite obvious to me.

    you posted: "I know boards like these arent meant to help but I need some sort of guidance" ... .

    Which is also completely wrong - we help hundreds of students and others, with C programming problems. How can you look at this forum, which is filled with help requests and helpful answers, and write that?
    A: I dont like using borland, I much perfer dev
    AND
    B: the last time I asked a "educational question" a admin told me off
    AND
    C: the only other langue I've used is visual basic

    and out of all that you wrote this is the only thing I thank you for:
    "Borland IDE has hundreds of examples you can bring up, including nearly any key word in C, just by pressing crtl + f1, an index to every key word in C/C++ is shown, with a search available including an example in code"
    but I dont thank you for any thing before or after those 2 sentences
    Last edited by geekrockergal; 02-01-2009 at 07:44 AM.

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    And the Turbo compiler is very out-of-date, which means avoiding it.
    Also, for the record, Bjarne, the creator of C++, originally created C++ to meet the needs of several languages. The speed of C, as well as more features such as OOP from other languages.
    That is why C++ is such a popular tool today, and why it is also such a great tool.
    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.

  13. #13
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > And the Turbo compiler is very out-of-date, which means avoiding it.
    Turbo C++ isn't but Turbo C is. Either way not a very good compiler IMO.

    > That is why C++ is such a popular tool today, and why it is also such a great tool.
    And also what sometimes makes it a terrible tool for the job

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Well, it can't be good at everything, no
    But the same goes for C, and any other programming language as well
    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.

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > and any other programming language as well
    Lisp seems to come close... but that has a silly name so we can ignore it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM

Tags for this Thread