CodeBlocks vs Dev c++

Pages: 12
Hello guys!

I am learning c++ with CodeBlocks. But in video turtorial for c++
guy is using dev c++, but i do all the same except it is in CodeBlocks, and it wont work, why???

This video: http://www.youtube.com/watch?v=16yji8At2UI

O and something else, is c++ diferent from program to program, because the same code vill work in some program in some wont.

I am from Croatia so have understanding with my english :)
Last edited on
This guy is an amatuer, I'm 128 seconds into his video and I already want to break something.

C++ is pretty much standardized, there are a few exceptions between IDE's but ideally you won't notice them. You should know that the current iteration of Code::Blocks filters out any "system(...)" calls but it runs your app in a shell so that it pauses at the end of it's execution when run from you IDE anyway, for you this means that "system("pause");" does not need to be in your code.

Are you getting any errors? What are they?
Dev-C++ is old and bad. If something works on Dev-C++ but not on C::B ( or any other IDE/Compiler ) is because who wrote the code is a bad programmer.
http://www.cplusplus.com/forum/articles/36896/
Ok thanks.

I get errors in visual c++ 2008,

http://img850.imageshack.us/f/48471121.png/ or http://img857.imageshack.us/f/source1.png/

or http://img849.imageshack.us/f/problem2g.png/

it seems to me that the visual c++ 2008 is complicated for the beginner.


And what is the best IDE for beginner.
Do you now any better youtube Tutorial ?
closed account (1yR4jE8b)
I skipped ahead randomly and the part I was at was where he (more or less) says: "Put #include <iostream> at the top, you don't really need to know what it does, just that you need to put it at the top everytime"

It's people like him teaching that there are so many criminally incompetent C++ programmers out there.
Last edited on
+1 darkestfright.

He probably doesn't even know what it does himself. Well, that's what happens when you have people making video tutorials with the knowledge they have picked up in their "computer science" (quotes intentional) classes in jr high.
To my shame I watched it till the end, and I think he said something like: "...after some of these tutorials (you) will be expert C++ programmers in no time" at the end of the vid [/facepalm]

@baranjac123
And what is the best IDE for beginner.

use vc2008 but do it in command line -go to Start->Visual Studio...->Visual Studio Command Prompt; from the command prompt use an editor to edit your source e.g

C:\my cplusplus\notepadmain.cpp
{type your codes in notepad}
C:\my cplusplus\cl main.cpp
{compile your codes and run it}


Do you now any better youtube Tutorial ?

None that I care to recommend
Last edited on
Because I had nothing better to do, I counted and made a list of the errors/incompetencies:
1: Said Dev-C++ is a compiler.
2: He's using Dev-C++ in 2008...
3: Says one doesn't need to know what #include does.
4: Says #include processes a source file before compilation which says "pretty much" nothing.
5: Says that all .cpp files are made out of functions, without making any note about objects
6: Says we don't need to know what "using" does. Hell yes we do!
7: His styling is off. In fact, Dev-C++ tried to correct him on this one by adding a tab.
8: He misdefined the purpose of the semicolon. It just indicates the end of an instruction, geez.
9: Use of system() in an invalid context.
10: Use of system without the #inclusion of <cstdlib>
11: Completely understates the difficulty of learning C++ for some people.
---Outside of this tutorial:
12: His tutorials completely leave out all the OOP.
13: He never touches C++ type casting in his tutorials either.


That comes out to 13 fairly severe errors. Normally I'm quite airy, but I've bookmarked this site for the purposes of making myself angry for any acting classes I might take.

P.S: I checked on some of his videos, and a frequent comment was that their anti-virus programs were objecting to the use of system(). :P

@baranjac123
The best C++ tutorials are text-based, I find. Here's one:
http://www.cplusplus.com/doc/tutorial/

-Albatross
Last edited on
 
Do you now any better youtube Tutorial ? 


I'd recommend you the tutorial on this site - video tutorials are not suitable for programming at all anyways. If you are done with that one, I'd suggest you to grab Stroustrups (you know, like the guy who pretty much invented C++) "The C++ Programming Language" to deepen your knowledge. Oh, and practice, practice, practice. There are many details about using the language that you will only learn by experiencing them first hand.
Last edited on
Ok, thank you once again!

So i should use visual c++ 2008 (in command line -go to Start->Visual Studio...->Visual Studio Command Prompt; from the command prompt use an editor to edit your source e.g), learn from cplusplus turtorial, and forget youtube.

P.S What is diference between CodeBlocks and visual c++ 2008?

Last edited on
Code::Blocks is free software and supports more compilers and platforms than Visual C++ but it's less integrated.
( http://www.cplusplus.com/forum/articles/7263/ )
I am angry!!!!!!!!!

I have been using this turtorial ( first example) http://www.cplusplus.com/doc/tutorial/operators/
and it works in codeblocks but not in visual c++ 2008, why to the crap not?????
That may depend on the project template you started from. On VC++ always start from an Empty Project
Visual C++ has a few more features (there is a 2010 version btw) and is optimized to make especially windows programming easier. However, that also means it has quite a few features that may confuse the new programmer, or lead them astray with features that require some knowledge about how they work.

Code::Blocks is not quite as heavily loaded with features, though you are unlikely to miss anything using it. It also has the advantage to be available on multiple platforms and it supports multiple compilers. It also has built-in support for wxWidgets (a quite nice platform independent GUI system). My only real complaint with it til now is that it's code completition system is not quite as sophisticated as Microsofts IntelliSense. C::B is what I personally use.

You could also use Eclipse, but I don't really have any experience with it.

PS: At the beginning, you won't need an IDE at all. Just a compiler and a text editor will do- doing stuff from the command line at the start will give you a feeling what exactly linking and compiling is, later you can move on to IDE's which will do all that annoying work for you. Thing is, just cause IDE's can do it for you doesn't mean you don't need to know what exactly is going on.
PS: At the beginning, you won't need an IDE at all. Just a compiler and a text editor will do- doing stuff from the command line at the start will give you a feeling what exactly linking and compiling is, later you can move on to IDE's which will do all that annoying work for you. Thing is, just cause IDE's can do it for you doesn't mean you don't need to know what exactly is going on.
I disagree with this. IMO a beginner should not care about the compiler stuff, but focus on programming.
When you know enough you can learn how your compiler works
Just saying that because when I started, I had lots of troubles cause I had no idea what the difference between compiler and linker errors was and constantly had to go cry in forums for help... I mean, you don't need to take a "Compiler Building" class, but having a general idea sure won't hurt.
Last edited on

Whats wrong with this code? Its not working in codeblocks or in visual c++ 2008, if it works for you , tell me how, thanks :)

// StringConcatenate - concatenate two string type
// variables with a “ - “ in the middle
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// read first string...
string string1;
cout << “Enter string #1:”;
cin >> string1;
// ...now the second string...
string string2;
cout << “Enter string #2:”;
cin >> string2;
// accumulate both strings into a single buffer
string buffer;
string divider = “ - “;
buffer = string1 + divider + string2;
// ...and display the result
cout << “n” << buffer << endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system(“PAUSE”);
return 0;
}
Your seem to write your code in a strange character set, I can hardly read it.

Anyways: You are including cstdio and cstdlib, which you both don't really need (except for cstdlib for system() maybe, but you can avoid the system("Pause") at the end simply by calling the exe from console).

Anyways:
Its not working
is very subtle, could you please tell us what exactly is not working?
now get this:

this code works in codeblocks but not in visual c++ 2008. How to set up visual so that i have no problems with code, and how to know which code is for which option?

#include<iostream>
using namespace std;

main()
{
int a, b, rezultat;
a = 7;
b = 12;
rezultat = a + b;
cout << "Zbroj ta dva broja je " << rezultat;

char x;
cin >> x;
return 0;
}
That's standard C++, it will work with visual c++ - UNLESS you select Win32 as your build target, in that case it will look for WinMain instead of main.
Pages: 12