Hi! I was an IS student last year and learned C in school. I can say that I learned a lot and is very familiar with C but unfortunately, since we're short of time, we weren't able to finish the entire book. I need to skip school this sem, perhaps this year but I would like to convert my learning to either C++ or C#. Can anyone please enlighten me why I should choose which one? thanks
C++ or C#?
Page 1 of 113 Replies - 794 Views - Last Post: 24 July 2011 - 10:00 PM
Replies To: C++ or C#?
#2
Re: C++ or C#?
Posted 20 June 2011 - 05:26 AM
C# is used with Microsoft's .Net, where C++ is much more cross platform so if you want to be able to write for Mac, Linux, iPhone, iPad, etc. then start with C++.
#3
Re: C++ or C#?
Posted 20 June 2011 - 05:45 AM
Thank you. I appreciate your reply. This site would really be very helpful while I learn this by myself... Which one has the highest demand today?
#4
Re: C++ or C#?
Posted 20 June 2011 - 07:03 AM
Depends on the market you are going for which has a higher demand.
#5
Re: C++ or C#?
Posted 20 June 2011 - 08:11 AM
I agree with lordofduct. Check the job listings in the market you are interested in. They are both pretty mainstream languages, though.
#6
Re: C++ or C#?
Posted 20 June 2011 - 08:19 AM
Another thing to consider is that C# is generally a little easier to learn than C++. C++ is a much lower level language than C#, so you'll be required to handle memory allocation, whereas the .NET framework usually handles this for you. C# might be easier to learn, but the ability to communicate with hardware on a lower level with C++ makes it a slightly more versatile language. Not to mention the cross-platform uses for C++. You can do C# cross-platform development, but it requires the use of an open source project known as Mono.
#7
Re: C++ or C#?
Posted 26 June 2011 - 08:30 AM
Understanding the fundamental principles behind the theory of programming is vital. Then all you've got to do is learn the syntax. Why not learn C# and C++,
Quote
get the best of both worlds!
#8
Re: C++ or C#?
Posted 29 June 2011 - 04:50 AM
Thanks all for the replies. I so appreciate it. This community will surely help me a lot as I go through my self pace study. I've just started C++ yesterday... I'm pretty comfortable with it since it appears to look like C.
But I need help, there's something that I don't understand from this code:
----------------------------------------
#include <iostream>
using namespace std;
int main() // Most important part of the program!
{
int age; // Need a variable...
cout<<"Please input your age: "; // Asks for age
cin>> age; // The input is put in age
cin.ignore(); // Throw away enter
if ( age < 100 ) { // If the age is less than 100
cout<<"You are pretty young!\n"; // Just to show you it works...
}
else if ( age == 100 ) { // I use else just to show an example
cout<<"You are old\n"; // Just to show you it works...
}
else {
cout<<"You are really old\n"; // Executed if no other statement is
}
cin.get();
}
----------------------------------------
What does | cin.ignore(); AND cin.get(); | do to the program? I removed it and it works the same...
I'm sorry, I'm such an idiot...
Thanks. - Mark
But I need help, there's something that I don't understand from this code:
----------------------------------------
#include <iostream>
using namespace std;
int main() // Most important part of the program!
{
int age; // Need a variable...
cout<<"Please input your age: "; // Asks for age
cin>> age; // The input is put in age
cin.ignore(); // Throw away enter
if ( age < 100 ) { // If the age is less than 100
cout<<"You are pretty young!\n"; // Just to show you it works...
}
else if ( age == 100 ) { // I use else just to show an example
cout<<"You are old\n"; // Just to show you it works...
}
else {
cout<<"You are really old\n"; // Executed if no other statement is
}
cin.get();
}
----------------------------------------
What does | cin.ignore(); AND cin.get(); | do to the program? I removed it and it works the same...
I'm sorry, I'm such an idiot...
Thanks. - Mark
#9
Re: C++ or C#?
Posted 29 June 2011 - 04:56 AM
I don't know. Try removing them and see if the program runs fine.
Usually those statements would be used to take care of some complication with an input stream, like if you wanted to handle an instance where the user entered more than one thing in their input
Some aspects of input strings have to be understood in C++. If you input two numbers with a space in between them, the system thinks you entered two completely different inputs, and will put both of those numbers into the stream as two different inputs.
Usually those statements would be used to take care of some complication with an input stream, like if you wanted to handle an instance where the user entered more than one thing in their input
Some aspects of input strings have to be understood in C++. If you input two numbers with a space in between them, the system thinks you entered two completely different inputs, and will put both of those numbers into the stream as two different inputs.
This post has been edited by Elliotd123: 29 June 2011 - 04:58 AM
#10
Re: C++ or C#?
Posted 01 July 2011 - 01:03 AM
cin.get() when used at the end of a program actually keeps the console window open so that the user may see the output, if any. What it does is basically wait for the user to input something, so that cin "gets" the input from the command prompt and THEN it will close. Otherwise, once the compiler finishes executing the last line of code, it will just exit from the file.
forgive me guys, posted this on the wrong topic by mistake
oh wait.. I didn't... Dammit.
jamesb1, on 01 July 2011 - 09:01 AM, said:
cin.get() when used at the end of a program actually keeps the console window open so that the user may see the output, if any. What it does is basically wait for the user to input something, so that cin "gets" the input from the command prompt and THEN it will close. Otherwise, once the compiler finishes executing the last line of code, it will just exit from the file.
forgive me guys, posted this on the wrong topic by mistake
oh wait.. I didn't... Dammit.
#11
Re: C++ or C#?
Posted 13 July 2011 - 10:47 AM
I'm working on learning both. Why? Well, I want the best of both worlds. I want to be able to code at a low level making fast, portable code that leverages the vast array of existing C++ libraries, AND I want to be able to quickly code up Windows apps using things like Unity with C#. Some things I just couldn't imagine doing in pure C++ instead of C#, & vice versa.
#12
Re: C++ or C#?
Posted 23 July 2011 - 10:26 PM
If you like C# and its style as opposed to C++ and still want cross platform then go with Java. It's similar to C# in a surprising number of ways and is far more universal.
#13
Re: C++ or C#?
Posted 24 July 2011 - 06:12 PM
If you program mostly on/for Windows then C# is a good idea. Not to mention, C# skills are often needed so it may be more profitable than C++ these days. If you want to do game programming or programming for the xbox then C# is also handy.
On the other hand, if you want to do programming on many machines and systems then C++ is a good choice. It's considerably more complex, but the skills gained from learning C++ will be valuable. If you can learn C++ then C# should be a simple walk in the park later.
On the other hand, if you want to do programming on many machines and systems then C++ is a good choice. It's considerably more complex, but the skills gained from learning C++ will be valuable. If you can learn C++ then C# should be a simple walk in the park later.
This post has been edited by stackoverflow: 24 July 2011 - 06:12 PM
#14
Re: C++ or C#?
Posted 24 July 2011 - 10:00 PM
Thanks to you all. I've read all your responses and it made me think more about it. I'm so glad to have found this community...
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote












|