Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 2 Weeks Ago   #1 (permalink)
Overclocker in Training
 
Exutus's Avatar
 
amd nvidia

Join Date: Oct 2009
Location: Au Quebec
Posts: 138

Rep: 6 Exutus Unknown
Unique Rep: 5
Trader Rating: 0
Default C or C++ ?

Yo


Well I'm wondering what one should learn first, C or C++ ?

I saw people on the net (youtube comments) saying to start with C++ and then C, I was like "huh ?"

I don't know the differances yet, but I'm sure C is less complex, and perhaps I'm wrong but C++ is just an extension pack lol ?

Anyway, I started learning the hello world, and strings and memory allocation for characters in C (3 little tutos), and I was wondering how to keep working my way up.

It looks more interesting than sudoku

Thanks!
__________________
System: Audio Prod and some Gaming
CPU
Athlon 64 X2 Dual Core Processor 6000+
Motherboard
ASUS M2N-E
Memory
Kingston HyperX (2 x 2 Gb) DDR2 - 800 MHz / PC2-64
Graphics Card
GeForce 9800 GT 512MB DDR3
Hard Drive
.5TB SeaGate Barracuda, 1TB Western Digital 10EADS
Sound Card
FA-66 FireWire, SB Audigy II, SoundMAX HD (Integ)
Power Supply
Antec EarthWatts 500
Case
Sonata III
CPU cooling
Has its fan on the heatsink, pipe on motherboard
GPU cooling
It has a fan in it...
OS
Linux, XP, Vista, Windows 7
Monitor
Samsung HDTV 19" 1360x768, Samsung 21.5" 1920x1080
Exutus is offline   Reply With Quote
Old 2 Weeks Ago   #2 (permalink)
Graphics Card Aficionado
 
Error 404's Avatar
 
amd ati

Join Date: Sep 2008
Posts: 962

Rep: 84 Error 404 is acknowledged by some
Unique Rep: 76
Trader Rating: 4
Default

C is more complex and a relatively low-level language. It doesn't have classes and many other things that C++ brings along. C++ was made after C as a sort of update (hence the appended "++." to increment a variable (say x) in C or C++, you type x++. Play on words of sorts.)

More info.


Overall they're similar in syntax for the most part, but I would focus on learning C++, and some C knowledge will come along obviously, but i doubt you'll end up using it that much.
__________________
I'm not terribly active at the moment...I'm caught up in school and such, so you have my advance apology if I don't respond to a post/PM the way I usually do.


4850 at 720 core/1100 mem - 1.2vGPU
3.5GHz Unlocked @ 1.42VCore Stable so far

Project: Sruth de athrú - An un-decided and slow-moving techstation project.

System: Baby Dragon
CPU
Phenomnom II 720 BE Unlocked.
Motherboard
GA-MA790XT-UD4P
Memory
2x1 GB Crucial "Value" D9JNL
Graphics Card
MSI R4850 512 MB
Hard Drive
500GB 'Cuda plus assorted others.
Sound Card
Onboard
Power Supply
OCZ StealthXStream 600W
Case
CM 690
CPU cooling
AMD 4-heat pipe cooler + IC7
GPU cooling
Stock with IC7
OS
Windows 7 RC x64/Ubuntu 9.04 x64
Monitor
Samsung 2343BWX High Density
Error 404 is offline   Reply With Quote
Old 2 Weeks Ago   #3 (permalink)
New to Overclock.net
 
intel nvidia

Join Date: Jan 2008
Posts: 524

Rep: 27 deafboy is acknowledged by some
Unique Rep: 26
Folding Team Rank: 910
Trader Rating: 0
Default

Depends what you want to do with it.

As far as the whole C thing goes I started with C# then C++ and now C.

If you want to make GUIs then C#

I personally like C more than C++ but it's just a preference thing.
__________________
System: My System
CPU
Intel Core 2 Quad Q6600 Kentsfield (G0) @ 3.5
Motherboard
GIGABYTE GA-965P-DS3
Memory
8GB CORSAIR DOMINATOR DDR2 1066 (PC2 8500 C5)
Graphics Card
EVGA 8800GTS 512MB G92 790/2000/1026
Hard Drive
WD 640GB AALS Black | WD 1TB FALS Black x 2
Power Supply
Thermaltake 750W ToughPower
Case
LIAN LI PC-V1100BPlus II Tweaked
CPU cooling
Xigmatek S1283 w/ S-Flex F and Backplate
GPU cooling
Accelero S1 w/ S-Flex F
OS
Windows 7 Pro RTM x64 | Ubuntu 9.04 x64
Monitor
Samsung ToC T260 | HDHanns·G HG-216DPO
deafboy is offline I fold for Overclock.net   Reply With Quote
Old 2 Weeks Ago   #4 (permalink)
Programmer
 
sailerboy's Avatar
 
intel ati

Join Date: Jun 2008
Location: Huntington Beach, CA
Posts: 786

Rep: 61 sailerboy is acknowledged by some
Unique Rep: 55
Trader Rating: 0
Default

I also personally like stdio.h more then iostream. You can use C headers and C++ headers interchangeably if you want in a C++ project. You can code purely C in a C++ project if you want. Its up to you and whatever is easier for you to learn.
__________________




Join the deaf club if you are deaf
http://www.overclock.net/off-topic/5...deaf-club.html

System: TPSPC
CPU
Q6600
Motherboard
Gigabyte EP35-DS3L
Memory
4 GB Mushkin
Graphics Card
ATI Raedon HD 4850
Hard Drive
250 GB Western Digital 2500AAKS
Sound Card
None
Power Supply
Rosewill RD600N
Case
Coolermaster HAF932
CPU cooling
Heatkiller v3.0+XSPC RX360+Swifttech MCP655
GPU cooling
Arctic Cooling S1 Rev 2
OS
XP SP3
Monitor
HP w2207
sailerboy is offline   Reply With Quote
Old 2 Weeks Ago   #5 (permalink)
Programmer
 
Korben's Avatar
 
intel nvidia

Join Date: Oct 2008
Location: Florida
Posts: 2,410

Rep: 86 Korben is acknowledged by some
Unique Rep: 77
Trader Rating: 13
Default

I think you should start off with C first and get that foundation down, that will help when learning C++ making it even easier. Overall though both are great languages and if you learn one or the other first doesn't really matter in general. I personally started with C, but I'm enjoying C++ even more.
__________________
Currently Playing: Aion
Steam - KForKorben X-Fire - kforkorben
I did Latty's Linux Challenge and I now have tried Linux!
I am 54% addicted to Counterstrike. What about you?
4Ghz

System: Core i7 Build
CPU
i7 920 | 3.8Ghz
Motherboard
Asus | P6T Deluxe
Memory
Corsair | 6GB | 1600Mhz
Graphics Card
2x | EVGA | GTX 260 | SLI
Hard Drive
2x | VR 300GB + 1TB | Raid 0
Sound Card
Asus | Xonar DX
Power Supply
Corsair | 1000HX
Case
Antec 1200 | Window Mod
CPU cooling
TRUE 1366 | 2x Ultra Kaze
GPU cooling
Stock
OS
Windows 7 Ultimate| x64
Monitor
Samsung | T260
Korben is online now   Reply With Quote
Old 2 Weeks Ago   #6 (permalink)
Programmer
 
intel nvidia

Join Date: Jan 2007
Location: Lake Erie + MI + OH = ME!
Posts: 1,013

Rep: 57 Kirmie is acknowledged by some
Unique Rep: 49
Trader Rating: 0
Default

Quote:
Originally Posted by sailerboy View Post
I also personally like stdio.h more then iostream. You can use C headers and C++ headers interchangeably if you want in a C++ project. You can code purely C in a C++ project if you want. Its up to you and whatever is easier for you to learn.
That may be true but there are instances where the relationship makes you go "***?" When I was working on a parallel computing in C I accidentally used the C++ version of the compiler needed for MPI (mpiCC instead of mpicc). The fact is that the program compiled with zero issues and ran fantastic the first few tries. The program was made to do over a million loops though so when I upped the number of loops from a few thousand to about 200k I would get errors on a few runs. By 500k I could not complete a single run without an error. I re-wrote my code from scratch after trying to fix it for an entire week. I finally figured out that I was using the wrong compiler and had to turn it in for half credit late. That ended up being the difference in the grade level I got for that class too.

Long story short, you can use C with a C++ compiler no problem but sometimes there can be minute differences so if you are going to do anything complicated, like parallel computing through OpenMP, it is preferable to use the correct compiler. Sad part is that the book we used taught everything in C but our instructions on the compiler used the C++ version without specifying there was a difference so I thought I was using the correct one.
__________________
Come join OCNs 48-hour Fold-a-Thon NOW!!

Have you ever tried simply turning off the TV, sitting down with your children, and hitting them?

From American Dad:
I touched her hand... her hand touched her boob. By the transitive property, I got some boob! Algebra's awesome!

EVE (Kirmie, Brian Fellow) | ogame.org (Univ 35, Unv 41) | Gladiatus.us (Serv 7) | NativeKingdoms (Epatlan) | DoD:S

System: My giant
CPU
E6600 lapped
Motherboard
Asus P5n32-E 680i
Memory
2x1GB (unused ATM) & 2x2Gb Corsair XMS2 PC6400
Graphics Card
GeForce 9800GT 512MB
Hard Drive
WDJS SATA-II 160GB + WD80GB + WDAAKS Raid0 320GB
Power Supply
Apevia DarkSide 600W
Case
NZXT Zero
CPU cooling
IFX-14
GPU cooling
Stock
OS
Win7 64-bit / XP Media Center
Monitor
19" LCD
Kirmie is offline   Reply With Quote
Old 2 Weeks Ago   #7 (permalink)
New to Overclock.net
 
intel nvidia

Join Date: Nov 2009
Posts: 19

Rep: 2 Nakurusin Unknown
Unique Rep: 2
Trader Rating: 0
Default

Quote:
Originally Posted by Kirmie View Post
That may be true but there are instances where the relationship makes you go "***?" When I was working on a parallel computing in C I accidentally used the C++ version of the compiler needed for MPI (mpiCC instead of mpicc). The fact is that the program compiled with zero issues and ran fantastic the first few tries. The program was made to do over a million loops though so when I upped the number of loops from a few thousand to about 200k I would get errors on a few runs. By 500k I could not complete a single run without an error. I re-wrote my code from scratch after trying to fix it for an entire week. I finally figured out that I was using the wrong compiler and had to turn it in for half credit late. That ended up being the difference in the grade level I got for that class too.

Long story short, you can use C with a C++ compiler no problem but sometimes there can be minute differences so if you are going to do anything complicated, like parallel computing through OpenMP, it is preferable to use the correct compiler. Sad part is that the book we used taught everything in C but our instructions on the compiler used the C++ version without specifying there was a difference so I thought I was using the correct one.
I always consider those scenarios "the real introduction to programming" if you haven't experienced long hours trying to work out a problem where you made the most mundane & smallest mistake then you haven't really been introduced to programming yet!
__________________
System: Primary Comp
CPU
i7 860 @ 3.6GHz (1.31v)
Motherboard
MSI P55-GD65
Memory
Corsair XMS3 4x2GB
Graphics Card
XFX GTX 275 XXX Core Edition
Hard Drive
2x 750GB Samsung Spinpoint F1 + 500GB SG 7200.10
Sound Card
Asus D1
Power Supply
Corsair TX650W
Case
Coolermaster HAF922
CPU cooling
Prolimatech Megahalem
GPU cooling
Stock
OS
Windows 7 x64
Monitor
22" Samsung SyncMaster 2223nw @1680x1050
Nakurusin is offline   Reply With Quote
Old 2 Weeks Ago   #8 (permalink)
4.0ghz
 
hometoast's Avatar
 
intel nvidia

Join Date: Sep 2007
Location: Pennsylvania
Posts: 2,155
Blog Entries: 3

Rep: 164 hometoast is acknowledged by manyhometoast is acknowledged by many
Unique Rep: 132
Hardware Reviews: 3
Trader Rating: 16
Default

My

Learn C first. Before C++ was "C++" it was called "C with classes".

You can learn to write programs and make stuff happen faster learning c++ first.

You will understand what the what is really going on if you learn C first.

System: foot warmer
CPU
Q9550
Motherboard
EP45-UD3P
Memory
OCZ 2x2Gb ddr2-1066
Graphics Card
GTX260 700/1509/1000
Hard Drive
WD 320 AAKS
Power Supply
PP&C 610W Silencer
Case
CM Cosmos 1000
CPU cooling
Xig Dark Knight
OS
#7
Monitor
Samsung 204BW
hometoast is offline Overclocked Account   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 10:02 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12938 seconds with 8 queries