Is this (tiny) function portable?

I

Ioannis Vranos

Ioannis said:
What compiler are you using? Doesn't this compile to your compiler?


#include <cctype>
#include <string>
#include <algorithm>
#include <iostream>
#include <ostream>



int main()
{
using namespace std;

string s="THiS iS a TeST STRiNG";

transform(s.begin(), s.end(), s.begin(), tolower);

cout<<s<<endl;
}



C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.

/out:temp.exe
temp.obj

C:\c>temp
this is a test string

C:\c>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,200
Messages
2,571,046
Members
47,646
Latest member
xayaci5906

Latest Threads

Top