Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: c? c++?

  1. #1

    Question c? c++?

    what's the difference between c and c++?

    difference between c++ on windows and c++ on linux system?

  2. #2
    Banned
    Join Date
    Sep 2001
    Posts
    68

    Lightbulb

    I'll start this off:

    In C, anyvariable++ increases it's value by one after whatever you're doing to it, so C++ in ment to mean the next version of C, which it is
    After that there's C# (see-sharp), and then M$'s .Net iirc

    The same C++ code will have to be compiled differently for different OSs IIRC, as it's a compiled language, not interpreted each time it's run regardless of the OS

    C++ is more powerful because it has a much larger Standard Library

    It's also Object-Oriented. From what I understand, think of a pc card game. If you make the object/class 'pile-o-cards', you can then use instances of it in any card game, instead of tracking all the cards. In Solitare you redefine them to accept Aces, but in FreeCell you don't. They still act like a 'pile-o-cards', but you can taylor them to each game's rules, so it's faster too.

    Try the links in here, oh and here

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Posts
    187
    quick and dirty.....

    c was developed in the early '70's to be a powerful, portable languge. a lot of operating systems are written primarly in c....windows, unix.....

    c++ is a superset of of c, and adds object oriented features to c. c++ is arguably the most used language out there.
    i read in the july issue of wired that there's talk of a virtual machine for c++, if anything ever comes of that then you won't need to recompile the code to run on different operating systems, but until then binaries from unix won't run on windows, and vice versa.
    U suk at teh intuhnet1!!1!1one

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Posts
    29
    You need to know C before you start C++ because there is alot of C in C++ C++ is a more complex type of a format it works better and it is better to wright in C++ so youll have more option in coding but both lang is hard to learn and to understand but im sure youll get it with the proper tools and help
    Join the White Hat universe!

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    259
    Originally posted here by Proud
    and then M$'s .Net
    I thought .Net was a basic style of programming to follow up VB 6
    Alternate realities celebrate reality. If you cant handle the reality your in, then you wont be able to handle the one your attempting to escape to.

  6. #6
    >>difference between c++ on windows and c++ on linux system?

    Differnt compilers which have different header files for functions. Basic functioning and programming on a Win or *nix system will be the same though.

    >>You need to know C before you start C++...
    Not neccessarily. Lot of guys I know started with c++ and are doing pretty well.
    But if you decide to learn C++ first some basic knowledge of C would also do well since C++ can accomodate C in it. Like Jabberwocky said "C++ is a superset of C"

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Posts
    109
    Originally posted here by ihsir
    >>You need to know C before you start C++...
    Not neccessarily. Lot of guys I know started with c++ and are doing pretty well.
    But if you decide to learn C++ first some basic knowledge of C would also do well since C++ can accomodate C in it. Like Jabberwocky said "C++ is a superset of C"
    I agree, you don't need to know C before C++. I learned C++ without any previous knowlege of C, and do quite fine - infact my school teaches you C++ and never any C. I can't say I really know how to progam in C, but I can understand decently commented C code without problems.

  8. #8
    Ok so you know the history of C and C++ and that C is a subset of C++. C is a Structured programming language. While C++ is an Object-Oriented Language. You can do a lot of stuff in C++ as compared to C.

    Structured programming language i.e. C uses modules and functions that perform specific tasks like printing text, performing calculations etc. Functions make it easy for the programmer to divide his programs into a no. of tasks, thus making it easier to program. It uses the concept of divide and conquer. Functions can be either provided by the manufacturer of the compiler (pre-defined functions) or could be made by you (user-defined functions).

    You can say that C is a go to less programming as it seldom uses go to statements. Most of the operations in C are done using the following constructs: Sequence, Selection and Repetition. Sequence is a step by step execution of program statements, Selection is the use of conditional execution like the well-known if statement (or functions in C) and Repetition is the repetition of a group of statements like in While statement and For statements.

    Object-oriented programming languages (like C++) use the concept of re-usability of software or program components. You don’t have to re-invent the wheel. It uses the concept of information hiding, inheritance and polymorphism.

    Like in C, C++ mostly uses pre-defined functions. It uses classes to hold data and functions. Data are states of the classes and functions are behaviors of the classes. Functions present in a class manipulate its data. Objects are instances (or implementations) of classes.

    Classes communicate with one another so they provide that data to other classes that is necessary and hide the rest of the info. It is much like driving a car without knowing its internal working.

    Inheritance allows one class to inherit some properties like data and functions from other classes. The class that inherits is called sub-class and its parent class (from which other classes inherit) is called the super class.

    Polymorphism is one interface but many implementations. You can do a lot of stuff by giving one command. I think that’s all you need to know about polymorphism at this moment.

    For programming in Windows you will have to use Visual C++. However you will need to learn C++ to use VC++. In MS-DOS and LINUX based programming the C++ program calls the operating system to get the user input and in Windows based programming the OS i.e. Windows issues messages whenever a user inputs something e.g. mouse clicks and button press etc for all of these special messages are sent to the C++ program. The messages sent by Windows are mapped in the C++ programs to perform a specific task using a the data received from the OS.

    I hope that this helps. If you have any doubts then don’t hesitate to ask.

    For more info about C language visit the site:
    www.cprogramming.edu

    If u want to see online journals on C/C++ then visit:
    www.cuj.com
    www.ddj.com
    With great power comes great responsibility.

  9. #9
    Senior Member
    Join Date
    Feb 2002
    Posts
    170
    This might be somewhat off topic but I thought I'd say some anyway. I see there's something of a confusion around C# and .NET and I thought I'd clear it up.

    I've been programming C# for the last two years and that's longer than the language have been publicly available. I've written a number of articles on C# in European and American magazines and I run one of the largest C# sites on the internet. Let me share my views on C# and .NET

    C# is *NOT* the next dialect of C. At least no more than Java is. The syntax is similar but the inner workings are wholly different. C# is created for use with the .NET class library, executing withing the .NET runtime. Much like Java does with its JVM or VB does with vbrun.dll.

    There is however a desire by some people (at Microsoft amongst others) that C# is viewed as the next version of C. The thing is that C# isn't a stand alone language. It can't be used with out the .NET Common Type System, the Common Language Runtime, both part of the .NET Common Language Specification.

    There are currently ports beeing developed for linux (go-mono.com) and freeBSD (a cooperation between MS and Corel) of both the .NET runtime and C#.

    Concerning .NET it's more than guidelines. .NET is a runtime, a set of classes and a way to write programs using .NET enabled languages (languages that follow the .NET specification).

    Visual Studio .NET and the .NET SDK ships with four .NET enabled languages C#, VB.NET, JScript.NET (which now, low and behold is an actual programming languge) and C++ with managed extentions (which, if anything should be regarded as the next version of C++).

    There's also a nifty little language called J# that from a strategic point of view looks like a .NET enabled J++ with all the politics that came with the latter.

    Anyway. I gotta go. Hope I could help some. Any questions -> PM me.

    Cheers,
    Mankan

    \"The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise.\"
    - Edsger Dijkstra

  10. #10
    Senior Member
    Join Date
    Nov 2001
    Posts
    109
    Originally posted here by Mankan

    C# is *NOT* the next dialect of C. At least no more than Java is.
    Thanks for clearing that up - I never considered C# the predicessor to C/C++

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •