Multi-threading in C#

A simple mult-threading in c# .

 

 

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

namespace ConsoleApp1
{
    class MyThread
    {
        public static void Main(String[] args)
        {
            Console.WriteLine("Threading test : ");


            Task1 t_one = new Task1();
            t_one.num = 5;

            //Thread one
            Thread thread1 = new Thread(t_one.Print);
            thread1.Name = "Thread 1";
            thread1.Start();

            //Thread two
            Thread thread2 = new Thread(t_one.Print);
            thread2.Name = "Thread 2";
            thread2.Start();

            thread1.Join();
            thread2.Join();

            Console.WriteLine("All done");

            Console.ReadKey();
        }
    }

    class Task1
    {
        public int num;

        public void Print()
        {
           
            for(int i=0;i< num;i++)
            {
                Console.WriteLine(Thread.CurrentThread.Name + " : " + i);
                Thread.Sleep(1000);
            }
            Console.WriteLine(Thread.CurrentThread.Name +" done");
        }
    }
}

Constant pointers and Pointers to constant in C

#include <stdio.h>
int main()
{
	int val = 250;
	int val2 =300;

        // ptrInt is a pointer to integer constant
        const int* ptrInt = &val; //Pointer to Constant

        // ptrInt1 is a constant pointer to integer
        int* const ptrInt1 = &val; //Constant Pointer

        *ptrInt = 500; //pointer to constant wont allow

	ptrInt1 = &val2; //constant pointer wont allow

	return 0;
}

Tic Tac Toe game in C++

This is a tic tac toe game made in C++. The game starts with player choosing the symbol O (letter) or X.

The A.I is pretty much basic.

screenshot

Download Link:

https://app.box.com/s/dwdcz3uwnd5qfafypjrp