Help needed for using transform-toupper function [SOLVED]
-
Hello I am getting following errors for my simple code:
@#include <QtCore/QCoreApplication>
#include <algorithm>
#include <QDebug>using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
wstring str = "hello";
transform(str.begin(),str.end(),str.begin(),::toupper());
qDebug() << str.c_str();
return a.exec();
}
@@error: conversion from ‘const char [6]’ to non-scalar type ‘std::wstring’ requested@
@/usr/include/ctype.h:119: error: too few arguments to function ‘int toupper(int)’ at this point in file main.cpp:11@Can anyone please try to guide me where I went wrong?
-
I've got it! Here is the resolved thread: "LINK":http://stackoverflow.com/questions/7131858/stdtransform-and-toupper-no-matching-function
-
Hi and welcome to devnet,
Since you are using Qt why not use QString ?