User Panel
Posted: 4/4/2006 3:04:49 PM EDT
I want to write a relatively simple (I think) computer program.
Can I just get a C/C++ for Dummies book? What software will I need, where do I buy it, and how much will it cost? |
|
cheapest way is to:
1. Download Linux 2. use g++ as your compiler 3. google "g++ tutorial" and/or "C++ tutorial" to learn how total price: $0.00 /******************* My first program (i think this is correct) *******************/ #include <iostream>; using namespace std; void main(){ cout << "hello world!"; } |
|
Sure, just buy the C++ for dummies book. It'll have everything you need in there.
|
|
If the book comes with a compiler, then yes. Otherwise david_g17 makes a good suggestion. |
|
|
PCGrasp is free and includes support/compiling for Java, C++, and Ada at the least.
|
|
Forget C/C++. If you want to write a simple program, just download a Windows-compatible version of Perl and write the program in Perl. |
|
|
No, use Python! |
||
|
I was being sarcastic. He hasn't even given us any idea as to what he want's the program to do or what platforms it needs to run on. C++ is pretty difficult for somone who doesn't know what they are doing, and C++ is probably one of the least flexible languages out there. Pearl would be a much better choice IMHO, but then again we don't know what he wants to do. |
||
|
I had my first computer class in University in 1982.
Back then computer class meant taking computer language classes. I took FORTRAN, BASIC, PASCAL and two other languages I can't even remember. The first real program I wrote was to pick lotto numbers with highest odds based on previous drawings. I once won $59 on a lotto ticket. |
|
Yeah depending on what you want to do, Perl and PHP are much easier to use and more 'useful' for every day tasks. C/C++ has its main advantage in speed and systems programming.
|
|
buy a used ibm as400, install cobol and program in cobol or rpg (cant remember the versions).
|
|
+1 on Perl, kick ass language |
|
|
True. I don't know what his goal is. To teach himself some programming, or to have a small program do something. I can come up with an algorithm and write the Perl script pretty quickly. He would just have to install a Perl compiler on his PC, add the directory of the perl.exe to his PATH environment and I could just send him my program for one billion US dollars. |
|
|
There ya go
#include <iostream> using namespace std; int main() { cout << "Hello World From About\n"; } |
|
10 RUN "KICK.ASS"
20 INPUT = "NAME" 30 IF "NECESARRY"="Y" THEN GOTO 10 40 END PROGRAM |
|
You must use 'endl' it is the iostream way!!! |
|
|
Real men use Bourne too! #!/bin/sh echo "Hello" |
|
|
I prefer Bourne Again! |
||
|
OMG haven't seen that since TRS-80 |
|
|
oh hell, i am reasonably sure its not even correct syntax. would have been basic apple IIe |
||
|
IMHO
Perl is cool for us programmers mainly because it lets us be sloppy. not having to declare variables and do type conversions is all well and good. However, I learned on C (and a bit of C++). C teaches good methods and enforces better methods of programming. Its a bit harder and doesn't allow you to be sloppy (least not as badly). Once you learn it, you pick up other languages pretty easy. IMHO Once you are there you are thankful for languages like perl which let you skip compiling and alot of things. But take note, there are things like performance penalties that can be an issue if you care about such things depending on what you are doing. IMHO -Foxxz |
|
Nope, it isnt but the numbers are killing me 10 print "hello world" 20 got line 10 |
|||
|
for simple programs C++ isn't hard to learn that's what we learned on in my CS classes won't be taking full advantage of it's power, but c++ doesn't have to be complicated |
|||
|
iostream, at least the older .h version would work with the escape character as well as endl |
||
|
Well yeah of course. I'm just sayin'. Most of the profs and students while I was in school would just mix C and C++ anyways, declaring C++ headers and then using printf anyways. |
|||
|
|
|
>10 CLS >20 ? Howdy, y'all! >30 goto 10 There ya go. 5 points to the person who recognizes it. |
|
|
If you are looking for a book to help you I would say not to get the 'Dummies' series there are much better programing books out there trust me I have struggled through C++, JAVA, HTML, JAVA Script and PHP. There is plenty of free information that is very helpful on the web just google for it the more specific you get the better the search.
|
|
Try Java. There is no automated garbage collection in C and as a newbie it sucks to spend 3 days to find the simple typo that makes your program segfault without further error messages. Perl syntax is nice if you can program, but the sloppy syntax is going to give you some bad habits if you can't program anything else. |
|
|
If using Mac OS X, all the C/C++ goddies are included, just open a Unix shell and code away
|
|
A good debugger is a C/Java programmers best friend. I work with C folks who load there programs with printf() debugging statements. Most of the Java guys seem to do the same thing. Learning how to malloc() and free up the memory puts hair on your chest |
||
|
+1 on C++ as a way to learn to program. C++ is the structured programming language to learn. It developes good programming habits and is very portable. It works on PC's to embedded applications. It is even similar to VHDL which would help him if he ever wanted to do digital hardware.
Now C++ may not be the easiest way to do what he wants. |
|
+1 on C++ as a way to learn to program. C++ is the structured programming language to learn. It developes good programming habits and is very portable. It works on PC's to embedded applications. It is even similar to VHDL which would help him if he ever wanted to do digital hardware.
Now C++ may not be the easiest way to do what he wants. |
|
eww, JAVA (garbage collection is the devil)
eww, C++ (double eww on g++) Perl is cool. G2 is cool also. Mixed C/ASM > all. C is user friendly - it's just picky about it's friends. btw I'm pretty sure 'endl' flushes the buffer whereas '\n' doesn't necissarily do so. (Remember iosteam is buffered output) There is a difference! |
|
nitpick... Can't declare a function as an int and not return a value, though declaring it as int vice void is the correct C++ way... :) |
|
|
Sign up for the ARFCOM weekly newsletter and be entered to win a free ARFCOM membership. One new winner* is announced every week!
You will receive an email every Friday morning featuring the latest chatter from the hottest topics, breaking news surrounding legislation, as well as exclusive deals only available to ARFCOM email subscribers.
AR15.COM is the world's largest firearm community and is a gathering place for firearm enthusiasts of all types.
From hunters and military members, to competition shooters and general firearm enthusiasts, we welcome anyone who values and respects the way of the firearm.
Subscribe to our monthly Newsletter to receive firearm news, product discounts from your favorite Industry Partners, and more.
Copyright © 1996-2024 AR15.COM LLC. All Rights Reserved.
Any use of this content without express written consent is prohibited.
AR15.Com reserves the right to overwrite or replace any affiliate, commercial, or monetizable links, posted by users, with our own.