Conver

10/16/2012 18:26 szymek111#1
Hi how i convert this code to c++ ? Please help me

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Login_server__Final_version_
{
class Program
{
static void Main(string[] args)
{
Thread one = new Thread(WriteY);
one.Start();
Thread two = new Thread(WriteX);
two.Start();
Console.ReadLine();
}

static void WriteY()
{
for (int i = 0; i < 20 ; i++ )
{
Console.WriteLine("y");
}
}

static void WriteX()
{
for (int i = 0; i < 20 ; i++ )
{
Console.WriteLine("x");
}
}
}
}
10/16/2012 20:00 SmackJew#2
Code:
#include <iostream>
#include <Windows.h>

using namespace std;

DWORD WINAPI writeX(LPVOID lpParameter) {
    for(int i = 0; i < 20; i++)
        cout<<"x";
    return 0;
}

DWORD WINAPI writeY(LPVOID lpParameter) {
    for(int i = 0; i < 20; i++)
        cout<<"y";
    return 0;
}

int main() {

    CreateThread(NULL, 0, writeX, NULL, 0, NULL);
    CreateThread(NULL, 0, writeY, NULL, 0, NULL);
    cin.get();
    return 0;
}