473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

std::cout << "sdfsdf" in MS Visual Studio 2005

ek
I thought that the syntax for c++ in either winXP or linux was the
same.

In Ubuntu linux it works fine if I write:

#include <string>
using namespace std;

int main()
{
string bb = "fff";
std::cout << bb;
return 0;

}

But in winXP in MS Visual Studio 2005 'cout' is not recognized in 'std'

I also have to declare a string like: std::string s = "ffff". Why does
'using namespace std' not work in winXP.

What are there reason for this and are there many cases where C++
syntax in linux is not compatible with C++ syntax for MS Visual Studio?

Dec 23 '06 #1
4 2919
ek wrote:
I thought that the syntax for c++ in either winXP or linux was the
same.

In Ubuntu linux it works fine if I write:

#include <string>
using namespace std;

int main()
{
string bb = "fff";
std::cout << bb;
return 0;

}

But in winXP in MS Visual Studio 2005 'cout' is not recognized in 'std'

I also have to declare a string like: std::string s = "ffff". Why does
'using namespace std' not work in winXP.

What are there reason for this and are there many cases where C++
syntax in linux is not compatible with C++ syntax for MS Visual Studio?
#include <iostream>

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
Dec 23 '06 #2

Pete Becker wrote:
ek wrote:
I thought that the syntax for c++ in either winXP or linux was the
same.

In Ubuntu linux it works fine if I write:

#include <string>
using namespace std;

int main()
{
string bb = "fff";
std::cout << bb;
return 0;

}

But in winXP in MS Visual Studio 2005 'cout' is not recognized in 'std'

I also have to declare a string like: std::string s = "ffff". Why does
'using namespace std' not work in winXP.

What are there reason for this and are there many cases where C++
syntax in linux is not compatible with C++ syntax for MS Visual Studio?

#include <iostream>

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
#include <iostream>
#include <string>
using namespace std;

int main()
{
.......
}

Dec 23 '06 #3
ek

fireflyc skrev:
Pete Becker wrote:
ek wrote:
I thought that the syntax for c++ in either winXP or linux was the
same.
>
In Ubuntu linux it works fine if I write:
>
#include <string>
using namespace std;
>
int main()
{
string bb = "fff";
std::cout << bb;
return 0;
>
}
>
But in winXP in MS Visual Studio 2005 'cout' is not recognized in 'std'
>
I also have to declare a string like: std::string s = "ffff". Why does
'using namespace std' not work in winXP.
>
What are there reason for this and are there many cases where C++
syntax in linux is not compatible with C++ syntax for MS Visual Studio?
>
#include <iostream>

The problem was that I typed 'using namespace std;' in a header file.
It seems that this is a wrong use and it should be typed in each source
file.

Dec 23 '06 #4
On 23 Dec 2006 06:21:34 -0800 in comp.lang.c++, "ek" <ek*****@yahoo.com>
wrote,
>The problem was that I typed 'using namespace std;' in a header file.
It seems that this is a wrong use and it should be typed in each source
file.
No, that is not the problem; there is no header file in your example in
which you could have typed the using directive. The problem as others
have noted is the missing #include <iostream>

Dec 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wendy Elizabeth | last post by:
I was just assigned a project at work to setup a CRM web system. However from what I have heard Visual Studio 2005 Team System is suppose to be a CRM system. Is it a metholodologythat Microsoft...
3
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in...
1
by: clkalluri | last post by:
Hi, I've installed (by that I mean a full uninstall and re-install) Visual Studio 2005 at least twice on my 64-bit windows machine (AMD64). I make sure I install the SDK 2.0 for x64, and the...
1
by: micky | last post by:
i've download vs studio team suite but it look like beta 2 CTP versio such as folder structure.. there are msdn, visio, vs ,vss folder and to check version this iso file i opened setup.ini and...
0
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the...
5
by: blackdog | last post by:
I have installed Visual Studio 2005, on the CD show Visual Studio 2005 team suite with 3 disks. I used to use Visual studio .NET 2003 and I used command csc.exe to compile csharp program. but...
0
by: Nattydreadlock | last post by:
Hello, I'm having some problems installing Visual Studio 2005. I'll briefly explain what's the history of the problem here. First I installed VS 2005 beta 2. I uninstalled it later via the...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
3
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the...
1
by: Dr T | last post by:
Hi! I downloaded MS Visual Web Developer 2005 Express Edition, MS .NET Framework SDK v2.0, and MS SQL Server 2005. Subsequently, I bought MS Visual Studio 2005 Professional Edition. 1) Are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.