Kosala Jayakody
Kosala Jayakody

Reputation: 25

How to use standard C++ code with Qt code in the same program?

string m ="kosala";
ui->label_5->setText(m);

This gives me :

string is undeclared identifier

I want to use string data type as in here without QString type. How can i do that?

Upvotes: 0

Views: 108

Answers (1)

Drew Dormann
Drew Dormann

Reputation: 63830

You possibly forgot

#include<string>

And you should call the type std::string.

std::string m ="kosala";

Upvotes: 1

Related Questions