Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help needed for using transform-toupper function [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

Help needed for using transform-toupper function [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sri1
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sri1
      wrote on last edited by
      #2

      I've got it! Here is the resolved thread: "LINK":http://stackoverflow.com/questions/7131858/stdtransform-and-toupper-no-matching-function

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Since you are using Qt why not use QString ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved