how i can convert string to int in c++ gui mode

Recommended Answers

All 2 Replies

how i can convert string to int in c++ gui mode

Please, refrain from hijacking threads. It would just confuse anyone having the same difficulty as the OP, and would make our jobs of attempting to answer to the original question difficult. If you have a question, like the one you asked, search the forum and see if the problem has been addressed before, and iff it hasn't, start a new thread stating your problem.

commented: Yes! They only hijacked this because it had "c++ gui" in the title. +32

Split to a new thread.

>how i can convert string to int in c++ gui mode
"GUI mode" is irrelevant. The process is the same. Have you tried a stringstream?

#include <iostream>
#include <sstream>
#include <string>

int main()
{
    std::istringstream in ( "10" );
    int i;

    in>> i;
    std::cout<< i * i <<'\n';
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.