Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 New to C++ help
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mehdij23




PostPosted: Sat Jan 14, 2006 4:19 pm   Post subject: New to C++ help

hey every one my name is mehdi and i just started using turbo c++, till my c++ from microsoft arrives. Is there a difference in terms of coding in C++ than trubo C++?


Please give me a feedback because when i put this in Turbo c++ it tells me i have 6 errors.

My Code

#include <iostream>
using namespace std;
int main ()
{
cout <<"hello world";
return 0;
}


Please help me out.....
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Jan 14, 2006 4:26 pm   Post subject: (No subject)

Use a decent, standards-compliant compiler. Like GCC. Turbo C++ is old, and does not comply with modern C++ standards.
Ninja




PostPosted: Fri Mar 10, 2006 9:13 pm   Post subject: (No subject)

hi guys. im new to c++ but ive been doing turing for a few months now. i started to get back into c++ today i downloaded and installed dev c++ and i tried this code out of a book my dad gave me today

# include <iostream.h>
# include <conio.h>

void main ()
{
float x , y , s ;
cout << "Enter the 1st number ";
cin >> x ;
cout << "Enter the 2nd number ";
cin >> y ;
s = x+y
cout << "x= "<<x<<" y= "<<y <<" x+y = "<< s << endl ; getch () ;

it shows many errors first one being conio no such directory found

can someone plz help me out on how to setup dev c++ so it uses the right directories..thanx a lot guys Smile

-NiNjA
Ninja




PostPosted: Fri Mar 10, 2006 9:19 pm   Post subject: (No subject)

also i have linux fedora core 4 running on vmware with win xp as host machine with all the programing utilities pre-installed on it..what program can i use there to learn c++ ?
wtd




PostPosted: Fri Mar 10, 2006 9:20 pm   Post subject: (No subject)

Using Dev-C++ is a mistake. It's buggy. Just use the command-line tools. They work reliably.

Secondly, the code you were given is old and non-standard. Learn standard C++ if you must learn C++ at all. (C++ is an atrocious intro language)
Ninja




PostPosted: Fri Mar 10, 2006 9:22 pm   Post subject: (No subject)

ye thats what i was thinking too lol..this book was printed in like 1996 lol..thanx bro..btw what compiler do u suggest i use rather then dev ?
idtt2s




PostPosted: Fri Mar 10, 2006 9:29 pm   Post subject: (No subject)

Dev-cpp is not a compiler.

I don't do Windows programming or C++ programming but I think that if you 've installed Dev-cpp then you have MinGW installed as well. MinGW is the Windows port of GCC, which is a popular C++ compiler. So I think if you can go to the MinGW directories you can use the command line tools.

type
code:
gcc input -o output

Them you can execute that. I think you can just type the filename in Windows in order to execute that.

And I think Dev-cpp should work fine for study pruposes. It at least lets you type in code and press "Compile & Run". That should be all you need.
[Gandalf]




PostPosted: Fri Mar 10, 2006 9:30 pm   Post subject: (No subject)

Dev-C++ is an IDE, not a compiler. This IDE uses the GCC compiler. The problem with Dev-C++ isn't the compiler it uses, but the actual program (Integrated Development Environment). You should use the GCC compiler with command line tools and a simple editor.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Mar 10, 2006 9:43 pm   Post subject: (No subject)

[Gandalf] wrote:
Dev-C++ is an IDE, not a compiler. This IDE uses the GCC compiler. The problem with Dev-C++ isn't the compiler it uses, but the actual program (Integrated Development Environment). You should use the GCC compiler with command line tools and a simple editor.


The problem is that in my opinion Dev-C++ does a ghastly job of setting MinGW up, then hides that with a bunch of config options that are hidden from you.

Installing MinGW or Cygwin (or just Linux) is a much better course of action.

Of course, ultimately not using C++ as an intro language is the best advice I can offer.
Ninja




PostPosted: Fri Mar 10, 2006 9:50 pm   Post subject: (No subject)

ye so can i use anything in linux to learn c++?

also i just installg mingw and tried to compile test1.c this is what dos said

iostream : no such directory

syntax erros before ':' token

warning : no new line at the end of file

the code i wrote in there was

#include <iostream>

int main()
{
std::cout << "Hello World." << std::endl;

return 0;
}
wtd




PostPosted: Fri Mar 10, 2006 9:53 pm   Post subject: (No subject)

Linux distros either come with GCC installed or you can easily install it with a package manager. And then you'd have a decent command-line. The prevalence of IDEs is largely the result of Windows being so common, and it having a terrible command-line interface. Wink

And that program looks fine to me. I have no idea why you're getting those errors.

What prior programming experience do you have?
Ninja




PostPosted: Fri Mar 10, 2006 10:06 pm   Post subject: (No subject)

well lol..ive never really done any hardcore programing back in india they started teaching us some old school c++ like the code i posted earlier but then when i moved to canada it kinda got side tracked then i forgot how to use it..ive been doing turing for a few months now but i just wanted to try out c++ because my dad is a pro programmer but he used old c++ before for oracle corp..he was a programer there for 5 years and also a linux/unix server admin..he said if i want to learn programing i should learn c++ after turing or side by side so i just wanted to try it out Smile
wtd




PostPosted: Fri Mar 10, 2006 10:10 pm   Post subject: (No subject)

Well, I have to disagree with your father. He suggested C++ because it's what he knew. I know lots of languages, and I know that C++ always ends up getting in the way.

What do I suggest in its place? Probably at the top of the list would be Ruby or O'Caml.
Ninja




PostPosted: Fri Mar 10, 2006 10:27 pm   Post subject: (No subject)

ye my friend steve from school told me about it..ive never actually used it or even seen it just heard about it..oh well ill start with c++ on linux for now lol Smile..hey man btw u got msn or anything?..if u do add me at rocker_akshay@hotmail.com
wtd




PostPosted: Fri Mar 10, 2006 10:46 pm   Post subject: (No subject)

You really should consider this carefully. You would genuinely benefit from something more expressive than C++.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: