Jump to content

how can I run? Compile?

- - - - -

  • Please log in to reply
10 replies to this topic

#1
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
I want to use Deitel C++ book and learn C++ but all compiler use different function for compile?
which compiler should I use?
I have MS Visual C++ 2010 Express but this doesn't work well!

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
For that book, almost any modern compiler will do the job.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
I want to compile my code which is like Deitel C++ book but when I try I can not.
for example I can not include iostream !!

#4
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Go to Tools then Options and under Projects and Solutions expand it and choose VC++ directories. In the drop down menu select include files then add an entry for wherever the include files you want to use are.

#5
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
This is what I get!

Attached Files



#6
lor

lor

    Programming Goddess

  • Members
  • PipPipPipPipPipPipPip
  • 884 posts
Um, Dev-C++ for an optional compiler?
BTW I have no idea why you wouldn't be able to include the iostream library...


#7
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
#include "stdafx.h"
#include <iostream>
using namespace std;
If I use #include "stdafx.h" at top I can do anything.
Is there anyway to remove "using namespace std"/?
And what is the different between "using namespace std" and "using namespace::std"

#8
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1

Hamed said:

Is there anyway to remove "using namespace std"/?
And what is the different between "using namespace std" and "using namespace::std"
What do you mean by remove? You can remove it but then you will have to type std:: infront of all STL functions and classes that you'll want to use. There's no difference (your 2nd question).
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#9
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Thanks
I know that I should use std at beginning of all std function but Is there anyway to not use "using namespace std" and std at beginning of all std functions?
(I think there is no way to do it)

Flying Dutchman said:

What do you mean by remove? You can remove it but then you will have to type std:: infront of all STL functions and classes that you'll want to use. There's no difference (your 2nd question).


#10
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
They seemed to have changed visual studio 2010. I'm still using 2008 so that's why I suggested that method of including. It uses property sheets now so you have to create one of those that can then be used in all projects. You'll have to read these:

VC++ Directories - VS Project Team Blog - Site Home - MSDN Blogs
VC++ Directories - VS Project Team Blog - Site Home - MSDN Blogs

#11
Zer033

Zer033

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts

Hamed said:

Thanks
I know that I should use std at beginning of all std function but Is there anyway to not use "using namespace std" and std at beginning of all std functions?
(I think there is no way to do it)

You have to do that to tell it that those functions are part of the std class. If you include neither then it can't know where those functions come from.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users