Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Difference Between C, C++ And C#?


44 replies to this topic

#26 Guest_pink_*

  • Guests

Posted 15 September 2010 - 09:57 AM

View PostiGuest, on 17 February 2008 - 10:40 AM, said:

If we want to operate on integer greater than 11 digits how we can operate
In C language?

-reply by Anjali


#27 Guest_pink_*

  • Guests

Posted 15 September 2010 - 09:58 AM

well u can use long int for number greater than 2^8

#28 Guest_pink_*

  • Guests

Posted 15 September 2010 - 10:00 AM

well C++ and C#are too structured land..u

#29 andrenievo

    Newbie

  • Kontributors
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Philippines
  • Interests:music, web blogging, surfing on the net

Posted 19 November 2010 - 03:25 AM

Both C and C++ give you a lower level of abstraction that, with increased complexity, provides a breadth of access to underlying machine functionality that are not necessarily exposed with other languages. C++ adds the convenience (reduced development time) of a fully object oriented language which can, potentially, add an additional performance cost. In terms of real world applications, I see these languages applied in the following domains:

C - * Kernel level software, * Hardware device drivers, * Applications where access to old, stable code is required.

C,C++
* Application or Server development where memory management needs to be fine tuned (and can't be left to generic garbage collection solutions).
* Development environments that require access to libraries that do not interface well with more modern managed languages.
* Although managed C++ can be used to access the .NET framework, it is not a seamless transition.

C# provides a managed memory model that adds a higher level of abstraction again. This level of abstraction adds convenience and improves development times, but complicates access to lower level APIs and makes specialized performance requirements problematic.

It is certainly possible to implement extremely high performance software in a managed memory environment, but awareness of the implications is essential.

The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the initiated programmer, a shallower learning curve.

C# - * Rapid client application development.
* High performance Server development (StackOverflow for example) that benefits from the .NET framework.
* Applications that require the benefits of the .NET framework in the language it was designed for.

#30 k_nitin_r

    Grand Imperial Poobah

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,114 posts
  • Gender:Male
  • Location:Dubai
  • myCENT:50.55

Posted 19 November 2010 - 06:45 AM

Everyone has mentioned about the stuff that you can do with C, C++, and C# and there's nothing left for me to say, really. I guess all I can do is complain about each of the three languages :-P

C
Let's begin with C. It is a quick and easy language to get started with, but working with pointers seems to be hard for many to manage. After you go beyond a few thousand lines of code, the source code becomes unmanageable for the average software programmer.

C++
C++ was meant to be an extension of C and is backward compatible for the most part. Pretty much anything that you can do in C also compiles and executes perfectly well in C++. But wait, that's a good thing. The negative is that the newer features it provides can slow down execution a bit. Object oriented development is a great way to organize your code and enforce some degree of separation between the various classes in your application (see the General Responsibility Assignment Software Patterns - GRASP for how this is done) but all of this includes overhead. You didn't think there was such a thing as a free lunch, did you?

C#
After having dealt with pointers, crashing applications, segmentation faults, illegal operations, and all of their little buddies, somebody thought it would be a really cool idea to clone Java. Yup, that's right. C# is a Java clone with some aspects of the C++ syntax worked into it. Running byte code (For C#, it is referred to as the Microsoft Intermediate Language) over a virtual machine comes from the Java world and C# has it. The virtual machine provides garbage collection and memory management, just as Java's virtual machine does. However, all of that comes with extra bloat. C# applications are hardly as efficient as C++ or C applications simply because of all that the platform has to offer, but it does make programming easier for novices.

I don't have a dislike for any of the three languages. Each has its place. C has found extensive use in system programming - for creating operating systems, device drivers, protocol stacks et al. C++ piggy-backs on the success of C while providing some degree of sanity to the spaghetti code. C# is the language for rapid development on the Windows platform. C# has nothing in common with C or C++ (the name is a marketing strategy!) except for some of the syntax but is in fact a clone of Java. If you want to write software as you do for Java but want to, for some bizarre twisted reason, want to prevent MacOS and Linux users from using it, you can pick C# as the programming language for your project.

#31 mahesh2k

    Trap Double Mocha Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,347 posts
  • Gender:Male
  • Location:Valley of Darkness
  • myCENT:27.17
  • Spam Patrol

Posted 19 November 2010 - 05:31 PM

One good thing about C# is that when it comes to game development, it's the best choice developers have. Java is memory leaker and extremly resource hungry. C++ has issue with memory management, unless people have some better framework to play with there is a lot of hassle for game developers.

Besides that there are plenty of gaming framework and tools coming up for c#. As there is Mono coming in for Linux so there is no loss of using C# for gaming. Atleast it is much better than C/C++ if you're into game development or want to start developing games.

#32 Quatrux

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 605 posts
  • Gender:Male
  • Location:Lithuania, Vilnius
  • Interests:Programming
  • myCENT:49.19

Posted 20 November 2010 - 08:00 AM

It's a little strange for me to see people posting that C# is a clone of Java, but C# syntax is similar to C++, it's practically C++ with .NET framework, but with additions, that were available on Java, but in this case what is Java? It's a clone of C++ written from scratch, which has similar syntax of C++, but it had to be a language which could be easier to use and got some new features.. So basically C# is a language from Microsoft to use their .NET framework as much and better as possible and steal part of the market from Java which got so pupular in those years, but it;s popularity is dropping every year.


http://en.wikipedia....of_Java_and_C++
http://en.wikipedia...._Sharp_and_Java

So both C# and Java is an easier to use and integrate clone of C++ offered for different an wider audience of programmers.

In any way, C++ is far more superior language to create real software and games, where C# can be used to create quite simple applications which doesn't require a lot of computer power, as it tends to be slower. C# is good if you need to write a program to do something, but for system programming, graphics, games, real-time and embedded systems, etc, C++ is a much better choice.

With C# you can create a simple program with GUI in lets say an hour, it depends on the functionality, I usually use it at my workplace when I need to do something quite simple using a GUI.

#33 mahesh2k

    Trap Double Mocha Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,347 posts
  • Gender:Male
  • Location:Valley of Darkness
  • myCENT:27.17
  • Spam Patrol

Posted 20 November 2010 - 07:43 PM

I don't know but i find that for memory mangement java and C# does a better job than C++. C++ has no way of dealing with it as it's not interpreter based language. Besides that for gaming and cpu intensive work C++ will fetch more memory than any other language be it java,python or C#.

Atleast as per my observation C# is good for gaming i.e game development.

#34 Iniyila

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 414 posts
  • Gender:Male
  • myCENT:98.30

Posted 30 November 2010 - 07:07 AM

C# has nothing to say in image processing with intel opencv. The performance of opencv in detecting shapes and colors, face detection, object tracking , ... is twice more than the performance of opencv(emgucv) in C#. c and c++ are almost the same in this manner but c has the advantage of using in embedded systems like armv7 processors.

Also C# is based on .net so it's not completely cross platform because you can not use your software in linux but c++ is a cross-platform language and you can change your software form windows compatible to linux compatible one with only a few changes. there is a mono project which is trying to bring .net apps to linux but the performance is very low and most of the apps doesn't run with it.

#35 mahesh2k

    Trap Double Mocha Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,347 posts
  • Gender:Male
  • Location:Valley of Darkness
  • myCENT:27.17
  • Spam Patrol

Posted 30 November 2010 - 02:23 PM

Mono has good performance atleast on ubuntu and there is one team working at ubuntu which helps app compatibility and testing. So if you're getting any app from official repository then chances are it is already tested and working. Most of the compatible apps of mono are already in repository and many people are not even aware of that it's there in the repository of ubuntu.

About app outside the universe repo, i think people need to work on their own for that. Because if not supported by distro then you are on your own anyway. That's linux for ya.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users