Jump to content
xisto Community
ZettaAIR

C++ Syntax

Recommended Posts

Why does the syntax that Visual C++ use and the syntax that Dev-C++ use look different? ?Like, ummmm...I have never used Visual Studio before but I can think of an example.Visual C++ uses ? ? ?printf( "blah blah blah" );Dev-C++ uses ? ? ? ?cout << "blah blah blah";This makes C++ seem all confusing...... ?Right now, I am learning HTML, and then PHP. ?Do you think PHP would be a better language to start than C++?

Share this post


Link to post
Share on other sites

I can tell you now that you'll probably get some strong opinions about what to learn. C++ is great, a fascinating language in my opinion, and very powerful. However, it will probably never serve you if your purpose is web design. If you are interested in web design go for these (more or less in order):1. HTML2. CSS3. PHP/MySQL4. Javascriptand then javascript libraries, Java if you want to develop web Apps, etc.in response to your question, printf("") is a C function, and "cout <<" is from C++. It doesn't make any since to use printf() in C++.P.S. If you're interested in iPhone apps learn objective C.I'm second guessing having put PHP before Javascript. I learned Javascript first. The fact is these days Javascript is used a lot and your PHP will probably be more or less dependant on it (for example, there is no AJAX without Javascript). So learn PHP, but make sure you understand the basics of HTML first, then Javascript, or else you wont be able to do anything with your PHP.My third reply...I just read that you want to be a software engineer and if that is the case C++ would definitely be something you could use. But the advice you get from people here is probably going to be from web designers and not many software engineers.

Notice from jlhaslip:
Merged consecutive posts
Edited by jlhaslip (see edit history)

Share this post


Link to post
Share on other sites

Well....I am interested in all sorts of things! Lol, I thought doing web design might be fun and a time killer for me. I also thought PHP would help me to better understand more advanced programming languages like C++. Maybe I should start with BASIC? It seems easy and I don't think it has those confusing, annoying, scary pointers. What would you recommend?

Share this post


Link to post
Share on other sites

Well....I am interested in all sorts of things! Lol, I thought doing web design might be fun and a time killer for me. I also thought PHP would help me to better understand more advanced programming languages like C++. Maybe I should start with BASIC? It seems easy and I don't think it has those confusing, annoying, scary pointers. What would you recommend?

c++ is great............ visual studio's has it's on way of doing everything just so you know.... also make sure you learn alot about javascript and html first... you need to have a very good understanding of html and javascript before you can do php.

and the language you learn depends on what you want to do... c++ is more for computer programs(you can use it for some intranet or internet programs) php is more for web browser based solutions(you can make desktop / standalone based programs out of it)

Share this post


Link to post
Share on other sites

To be honest, I learnt to program starting with QBasic and Visual Basic. They are both great for learning the basics of programming before trying to tackle some of the harder concepts. The other great thing about them is that it is really easy to get started, setting up C/C++ to start working with (especially the free versions) can be a bit of a nightmare. Plus you need to make sure you create a correct main function and what not. In VB (version 6 or lower) it is just a matter of writing some code and pressing 'play'. If there is anything wrong it will point it, sometimes even before you start the program. And you can make more complex programs with a GUI without needing a few months of learning.I have also begun learning PHP and while it is really useful, as a first language it probably isn't very forgiving. While the syntax is very C++ like it doesn't get compiled so debugging it can be a bit of a nightmare if you don't already know how do program or recognise any bad syntax. I have heard Python is another excellent starting language and is more C++ like. But you won't be making GUI's as easily.As for the syntax of printf vs cout, I'm pretty sure both can be used in either program, as long as the correct libraries are referenced. You need #include <stdio.h> to use printf. I find printf easier as the syntax is a little less retarded (printf still has its own retardations) and looks a lot more like normal C++.

Share this post


Link to post
Share on other sites

I learned some C first and then C++ learn before I ever got involved in the web (just this last year), but I would recommend HTML and Javascript. Don't worry about pointer, matter of fact, javascript is loose-typed, which makes it a really simply place to begin. To explain that means a variable can hold whatever you want it to:

var myVar; //declare new variablemyVar = false;  //boolean valuemyVar = 123  //numbermyVar = null  //nullmyVar = "Hello World!" //char str

you can do so much with little restrictions in Javascript, and for that same reason be careful! You don't even have to use semicolons most of the time, but the best practice is to put them everywhere they should be used.

C++ is like chess for me. Javscript is like a dance. They are both great, but in javascript you get to do whatever you want, and it's fast (not fast in the sense of interpretation, but in the sense of how long it takes you to do something). For example you can studying C++ for 6 months and not see anything but text on a screen. With HTML/Javscript you can do fancy animations in your first week.

One big advantage is that javascript doesn't need a compiler, just a web browser. Think about it, anywhere you have notepad and an internet broswer you can program and instantly see your results. That could be on you're grandma's computer! jk.

I made a pretty fun dice game in javascript in the first two weeks of learning it. In a minute I'll post the link so you can try it out. All I used was the basic files, a browser (firefox in this case), and a trial version of Photoshop 6 Elements to make the images.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.