I Have 3 Questions

Please help

  • (2 Pages)
  • +
  • 1
  • 2

21 Replies - 958 Views - Last Post: 27 February 2010 - 10:28 PM Rate Topic: -----

#1 zim1985  Icon User is offline

  • Grand Inquisitor
  • member icon

Reputation: 74
  • View blog
  • Posts: 568
  • Joined: 19-February 10

I Have 3 Questions

Posted 26 February 2010 - 11:18 PM

So I am looking to learn C and/or C++. 2 questions:

1) Which is better to start with? Should I go from C to C++ or just straight into C++?

2) What are good books or resources to learn from, beside this site of course?

Also, I have a Mac and I want to write C and C++ on it. So here's my last question:

3) What do I need to be able to compile and write these languages on my Mac?
Is This A Good Question/Topic? 0
  • +

Replies To: I Have 3 Questions

#2 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: I Have 3 Questions

Posted 26 February 2010 - 11:23 PM

You don't need C to learn C++.

I would suggest getting a $10 or $15 dollar beginner book off of amazon
- Practical C++ Programming - Nice to the point book
- C++ for Dummies - Slow paced book that reads like a book not a manual

There is also the tutorial at http://cplusplus.com/doc/tutorial/
As well as the tutorials on this site.

As for writing code on macs I don't have one so I have no input on this. You could do a quick google search to get started.
Was This Post Helpful? 0
  • +
  • -

#3 ZOMBIE!!!  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 206
  • Joined: 28-October 09

Re: I Have 3 Questions

Posted 26 February 2010 - 11:25 PM

Quote

3) What do I need to be able to compile and write these languages on my Mac?


You can use Xcode, but that uses a different form of C. Its called Objective C or something.
Was This Post Helpful? 0
  • +
  • -

#4 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: I Have 3 Questions

Posted 26 February 2010 - 11:44 PM

I think Code::Blocks is a cross platform compiler for win/linux/mac
Was This Post Helpful? 0
  • +
  • -

#5 javabie  Icon User is offline

  • D.I.C Head

Reputation: 36
  • View blog
  • Posts: 117
  • Joined: 12-February 10

Re: I Have 3 Questions

Posted 26 February 2010 - 11:55 PM

in xcode.. you could compile and run c and c++....
when you create new project on xcode... select application->command line and select the type as c or stdc++.....
Was This Post Helpful? 0
  • +
  • -

#6 sganesh_08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-February 10

Re: I Have 3 Questions

Posted 27 February 2010 - 12:38 AM

For me that, the best way is that to learn C first then you can go for C++.
Because C is a basic of C++. And C++ is just OOPs + C.

And K&R book is the best resource for C language, Because they only found that.

While learning this book itself you will know how to compile and run. There will not be much difference in MacOs. If you installed that compiler it will be same.
Was This Post Helpful? 0
  • +
  • -

#7 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: I Have 3 Questions

Posted 27 February 2010 - 12:48 AM

Quote

And C++ is just OOPs + C.

  • Templates
  • Namespaces
  • Default arguments
  • Operator overloading


C and C++ are very different languages in terms of logic. The syntax is similar, but the method in which you build the program is quite different.
Was This Post Helpful? 3
  • +
  • -

#8 zim1985  Icon User is offline

  • Grand Inquisitor
  • member icon

Reputation: 74
  • View blog
  • Posts: 568
  • Joined: 19-February 10

Re: I Have 3 Questions

Posted 27 February 2010 - 12:53 AM

Moving from Java I think I could understand it quite well.
Was This Post Helpful? 0
  • +
  • -

#9 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: I Have 3 Questions

Posted 27 February 2010 - 09:11 AM

View PostPlasticineGuy, on 27 February 2010 - 02:48 AM, said:

Quote

And C++ is just OOPs + C.

  • Templates
  • Namespaces
  • Default arguments
  • Operator overloading


C and C++ are very different languages in terms of logic. The syntax is similar, but the method in which you build the program is quite different.


+1

C++ is NOT just C with a few extras tacked on. It has come to light over the last 20 or more years that looking at C++ as an extension of C is really bad approach (although it is the typical one). It a much slower way to develop in C++ because you have to "unlearn" so many habits from C. I think that BECAUSE the two languages are so close, it is much better to learn the more advanced one first and then pick up the base one (i.e. learn C++ and then learn C). This way the compiler can help you, a C compiler will spit at you if you feed it C++, but a C++ compiler will let you use C if you want.
Was This Post Helpful? 2
  • +
  • -

#10 Guest_your name*


Reputation:

Re: I Have 3 Questions

Posted 27 February 2010 - 12:09 PM

If you have youtube, you can also search for C++ tutorial and look for the absolute n00b series. There are about 75 videos that show you certain aspects. It is also a good starting point. Not only are the aspects explained, but he shows you by example. It is also very important to keep in mind, this will give you a "Swiss cheese" education in the subject, and should not be used to replace good old study habits.
Was This Post Helpful? 0

#11 ice-t  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 104
  • Joined: 26-May 09

Re: I Have 3 Questions

Posted 27 February 2010 - 12:23 PM

i can speak for myself, i had trouble understanding C++ so i started with C and then C++,but now i have another problem, i tend to program C-style when i`m coding in C++ :(

As for a book , if u want C i`ll say Kernighan and Ritchie and for C++ , Thinking in C++ volumes 1 and 2

Hope u`ll find your answers :)
Was This Post Helpful? 0
  • +
  • -

#12 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 614
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: I Have 3 Questions

Posted 27 February 2010 - 01:10 PM

As far as the difference between C and C++, syntacially you wont see a difference (other than assiciated functions etc). Although, C++ instroduces OOP (Object Orientated Programming) and Polymorphism.

When you learn how to use classes (in C++), you will wonder how you ever programmed without them :)
Was This Post Helpful? 0
  • +
  • -

#13 dorknexus  Icon User is offline

  • or something bad...real bad.
  • member icon

Reputation: 1255
  • View blog
  • Posts: 4,618
  • Joined: 02-May 04

Re: I Have 3 Questions

Posted 27 February 2010 - 01:43 PM

Quote

3) What do I need to be able to compile and write these languages on my Mac?


OS X comes with the GNU Compiler Collection (gcc) pre-installed which means you get g++ to compile C++ source.
Was This Post Helpful? 1
  • +
  • -

#14 zim1985  Icon User is offline

  • Grand Inquisitor
  • member icon

Reputation: 74
  • View blog
  • Posts: 568
  • Joined: 19-February 10

Re: I Have 3 Questions

Posted 27 February 2010 - 09:23 PM

View PostAphex19, on 27 February 2010 - 11:10 AM, said:

As far as the difference between C and C++, syntacially you wont see a difference (other than assiciated functions etc). Although, C++ instroduces OOP (Object Orientated Programming) and Polymorphism.

When you learn how to use classes (in C++), you will wonder how you ever programmed without them :)

That said, I still don't if I should focus on C or C++.

Also, Objective-C and C#...what are they and how do they relate to C and C++.

It's not like I don't know how to program. I've been learning Java. But I want to expand my horizons. I won't be learning all this right away, but I want to get a plan in place.

So my new questions...

1) What should I start on, C or C++?
2) What are Objective-C and C# and should I plan to learn these as well?
Was This Post Helpful? 0
  • +
  • -

#15 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: I Have 3 Questions

Posted 27 February 2010 - 09:29 PM

Objective C is purely C with OOP.
C# is a completely different Java-style language.
Don't learn Objective-C unless you plan on working with weak computers, and C# is a totally different bowl of soup.

I would start with C++. As Bjarne Stroustrup (designer and original implementer of C++) said: "In C++ it's harder to shoot yourself in the foot, but when you do, you blow off a whole leg." Generally you screw up in C++ a lot less than in C.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2