Wolf_Lord Report post Posted February 19, 2005 Woot go me, go me, I just created my first C++ Program. Go me Go me, get my groove on go me. NeoSeS Share this post Link to post Share on other sites
Hammen Report post Posted February 19, 2005 C++ is great isn't it? If its your first C++ program, its probably just C, but built slower... Share this post Link to post Share on other sites
chatterbug89 Report post Posted February 19, 2005 Was it.. #include <iostream.h> int main() { cout << "Hello World ^^"; } Good luck thou Share this post Link to post Share on other sites
Wolf_Lord Report post Posted February 19, 2005 The File was //// Program to convert temperature from Celsius degree // units into Fahrenheit degree units: // Fahrenheit = Celsius * (212 - 32)/100 + 32 // #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { // enter the temperature in Celsius int celsius; cout << "Enter the temperature in Celsius:"; cin >> celsius; // calculate conversion factor for Celsius // to Fahrenheit int factor; factor = 212 - 32; // use conversion factor to convert Celsius // into Fahrenheit values int fahrenheit; fahrenheit = factor * celsius/100 + 32; // output the results (followed by a NewLine) cout << "Fahrenheit value is:"; cout << fahrenheit << endl; // wait until user is ready before terminating program // to allow the user to see the program results system("PAUSE"); return 0; } I got it out of the C++ for Dummies book, I'm also using this website http://www.cprogramming.com/tutorial.html to compliment the C++ for dummies book LOL Hammen C++ is great isn't it? I don't know, I'm just getting started But your right it's most likely simply a C program... but what do I know. Chatterbug Nope sorry, #include <iostream.h>int main() { cout << "Hello World ^^"; } Was my second program , I'm doing it all back aswards it would seem, I started with the hard stuff :lol: :lol: Good luck thou Thank you very much NeoSeS Share this post Link to post Share on other sites
Leeloo Report post Posted February 19, 2005 For the fahrenheit program: What the **** is cstdio used for? It's included but I don't see it used anywhere. For the hello-world program: It's #include <iostream>, not #include <iostream.h>. iostream.h is usually a special backwards-compatible library meant for programs written before the C++ standard was finalized (i.e. old crap), and lacks important things like namespaces, where as iostream (without .h) is the one you should be using when writing a program. Share this post Link to post Share on other sites
Placid Report post Posted February 19, 2005 Nice work neoses. You'll be coding server-side EL before we know it Share this post Link to post Share on other sites
Wolf_Lord Report post Posted February 19, 2005 For the fahrenheit program: What the **** is cstdio used for? Darned if I know Leeloo, I just wrote the program the way it was in the book, I don't even know what cstdio or iostream or any of these includes are yet. Give me time, I'm sure I'll figure it out eventualy... not #include <iostream.h>. You'll have to ask chatterbug, that was their program line not mine, I just copied and pasted it, I think when I wrote a similar program it was just the "#include iostream" line, I don't know what the "iostream.h" is at all. Nice work neoses. You'll be coding server-side EL before we know it LOL thank you Placid, we'll see what happens , right now I'm still looking into Boolean Algebra and studying variables more closely. Catch you all later, NeoSeS Share this post Link to post Share on other sites
chatterbug89 Report post Posted February 19, 2005 For the hello-world program: It's #include <iostream>, not #include <iostream.h>. iostream.h is usually a special backwards-compatible library meant for programs written before the C++ standard was finalized (i.e. old crap), and lacks important things like namespaces, where as iostream (without .h) is the one you should be using when writing a program. Yeah, I know...I started originaly reading out of some older book and got in the habbit of it. I'll be reading out of new sources now so i'll break my habbit. Share this post Link to post Share on other sites
Leeloo Report post Posted February 19, 2005 Nice work neoses. You'll be coding server-side EL before we know it Coding EL in C++? That would be over Entropys dead body Share this post Link to post Share on other sites
Wolf_Lord Report post Posted February 19, 2005 Coding EL in C++? Even if EL is not coded in C++, C++ is a steping stone to learning other languages isn't it? Once I learn and am fluent in C++ then I can move on to other projects and languages I don't know what I'm going to do with my newly aquired knowledge, but it's fun just to learn new things so, we'll just see what teh future holds. NeoSeS Share this post Link to post Share on other sites
Leeloo Report post Posted February 19, 2005 Yes, it's always easier to learn the second language, at least as long as it's the same genre (i.e. don't expect C++ knowledge to be useful if you go for Prolog or Lisp ), and for C, it does have a lot in common with C++, possibly even too much. At least get good with C++ first, so you don't start mixing the two. Some people will tell you to learn C first, but I think learning C++ before C is actually better, because a C compiler will tell you if you by mistake wrote some C++ code, where as writing C code in a C++ compiler gives no complaints (usually), so someone who learnt C first will never learn to write C++ unless he puts a big effort into not writing C. Otherwise he will just continue writing C code. Share this post Link to post Share on other sites
Wytter Report post Posted February 20, 2005 Good luck with the programming Neo - have fun Share this post Link to post Share on other sites
crusadingknight Report post Posted February 20, 2005 (i.e. don't expect C++ knowledge to be useful if you go for Prolog or Lisp ) Helps a bit ... Even though all I know are a bunch of curly-brace languages and BASIC, LISP still seemed a lot easier than learning a first langauge. Share this post Link to post Share on other sites
Leeloo Report post Posted February 20, 2005 (i.e. don't expect C++ knowledge to be useful if you go for Prolog or Lisp ) Helps a bit ... Even though all I know are a bunch of curly-brace languages and BASIC, LISP still seemed a lot easier than learning a first langauge. Someone who learned LISP as the first language might suggest that this is because LISP is much easier to learn in general OTOH, I tried to learn Scheme (a lot like LISP, if I'm not mistaken) for making Gimp scripts, but gave up - that language is just too different. And I already knew Basic, C, C++, Prolog, Miranda, a bit Postscript and 6502 (6510) and x86 assembly. Share this post Link to post Share on other sites
jakoblin Report post Posted March 2, 2005 who want to see code to make a program to format the hard drive ? if you do pm me . Share this post Link to post Share on other sites
Grum Report post Posted March 2, 2005 (edited) who want to see code to make a program to format the hard drive ? if you do pm me . ?? Here, I'll give a program out for free: #!/bin/sh partition = $1 mke2fs -j -T news $partition I'm sure Leeloo has something to comment on this program, but nvm that. It should work. EDIT: Oh, btw, congratulations neoses, gj Edited March 2, 2005 by Grum Share this post Link to post Share on other sites
Kougria Report post Posted March 2, 2005 I dont really know anything about programming, but Gratz Neo!!! - Kougria Share this post Link to post Share on other sites
Leeloo Report post Posted March 2, 2005 #!/bin/sh partition = $1 mke2fs -j -T news $partition I'm sure Leeloo has something to comment on this program, but nvm that. It should work. You mean, like why $partition, just use $1 and make it a one-liner? Share this post Link to post Share on other sites
Placid Report post Posted March 2, 2005 #!/bin/sh partition = $1 mke2fs -j -T news $partition I'm sure Leeloo has something to comment on this program, but nvm that. It should work. You mean, like why $partition, just use $1 and make it a one-liner? lol, I was thinking that. What IS the point of assigning the first param to the partition var Grummy? Share this post Link to post Share on other sites
Grum Report post Posted March 2, 2005 #!/bin/sh partition = $1 mke2fs -j -T news $partition I'm sure Leeloo has something to comment on this program, but nvm that. It should work. You mean, like why $partition, just use $1 and make it a one-liner? lol, I was thinking that. What IS the point of assigning the first param to the partition var Grummy? The point is, that I always forget what the parameters in a shell script are, so I've made it a habit to assign more or less meanigful names to them in the beginning of the script. I agree that probably in this case it was overkill, but in general I've found it very useful. Share this post Link to post Share on other sites
Placid Report post Posted March 2, 2005 The point is, that I always forget what the parameters in a shell script are, so I've made it a habit to assign more or less meanigful names to them in the beginning of the script. I agree that probably in this case it was overkill, but in general I've found it very useful. Ahh dont get me wrong, I see why you did it, just didnt think it was necessary. Share this post Link to post Share on other sites
lobonar Report post Posted March 2, 2005 hmmz... i tried programming C++, found it pretty boring, cause i couldn't do anything with it yet and besides that i heart is with programming websites in html php and javascript but neo congratz with your first prog and good luck with further programming Share this post Link to post Share on other sites