whats wrong with this??
#include <iostream>
#include <QThread>
using namespace std;
{
public:
void run()
{
while (true)
{
cout << "X" << endl;
msleep(500);
}
}
};
{
public:
void run()
{
while (true)
{
cout << "Y" << endl;
msleep(500);
}
}
};
int main(int argc, char *argv[])
{
Th1 *t = new Th1();
t->start();
Th2 *h = new Th2();
h->start();
//h->run();
}
#include <iostream>
#include <QThread>
using namespace std;
class Th1 : public QThread
{
public:
void run()
{
while (true)
{
cout << "X" << endl;
msleep(500);
}
}
};
class Th2 : public QThread
{
public:
void run()
{
while (true)
{
cout << "Y" << endl;
msleep(500);
}
}
};
int main(int argc, char *argv[])
{
Th1 *t = new Th1();
t->start();
Th2 *h = new Th2();
h->start();
//h->run();
}
To copy to clipboard, switch view to plain text mode
when i uncomment the last statement, it works...
im confused.
Bookmarks