cniper's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
51 (0.06 per day)
Joined:
02-July 12
Profile Views:
2,675
Last Active:
User is offline Aug 24 2013 07:24 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   cniper has not set their status

Posts I've Made

  1. In Topic: win32 multiple windows

    Posted 18 Aug 2013

    that worked thanks for pointing it out!!
  2. In Topic: win32 multiple windows

    Posted 18 Aug 2013

    ok i changed it to
    ghFirstWnd=::CreateWindow(L"MyWndFirstClass",L"MyWindow1",WS_OVERLAPPEDWINDOW,0,0,50,50,0,0,ghAppInst,0);
    ghSecondWnd=::CreateWindow(L"MyWndSecondClass",L"MyWindow2",WS_OVERLAPPEDWINDOW,50,0,50,50,0,0,ghAppInst,0);
    ghThirdWnd=::CreateWindow(L"MyWndThirdClass",L"MyWindow3",WS_OVERLAPPEDWINDOW,100,0,50,50,0,0,ghAppInst,0);
    
    

    still no luck!!
  3. In Topic: binary calculator problem

    Posted 13 Aug 2013

    hmmnn... nobody seems interested. so here is my final code:
    #include<iostream>
    #include<string>
    #include<iomanip>
    using namespace std;
    string decimalToBinary(unsigned char num)
    {
    	if(num==0) return "0";
    	if(num==1) return "1";
    	if(num%2==0)
    		return decimalToBinary(num/2)+"0";
    	else
    		return decimalToBinary(num/2)+"1";
    }
    
    int main()
    {
    	unsigned int a=0,b=0;
    	cout<<"enter decimal number a: ";
    	cin>>a;
    	cout<<endl<<"enter decimal number b:";
    	cin>>b;
    	string s1= decimalToBinary(a);
    	string s2= decimalToBinary(B)/>;
    	cout<<"a= "<<a<<"in binary is "<<setfill('0')<<setw(8)<<s1<<endl;
    	cout<<"b= "<<b<<"in binary is "<<setfill('0')<<setw(8)<<s2<<endl;
    	unsigned char c= a&b;
    	unsigned char d=a|b;
    	unsigned char e= ~a;
    	unsigned char f=~b;
    	unsigned char g = a<<2;
    	unsigned char h= b>>3;
    	unsigned char i=a^b;
    	string s3= decimalToBinary(c);
    	string s4= decimalToBinary(d);
    	string s5= decimalToBinary(e);
    	string s6= decimalToBinary(f);
    	string s7= decimalToBinary(g);
    	string s8= decimalToBinary(h);
    	string s9= decimalToBinary(i);
    	cout<<"a & b="<<setfill('0')<<setw(8)<<s3<<endl;
    	cout<<"a|b= "<<setfill('0')<<setw(8)<<s4<<endl;
    	cout<<"~a ="<<setfill('0')<<setw(8)<<s5<<endl;
    	cout<<"~b ="<<setfill('0')<<setw(8)<<s6<<endl;
    	cout<<"a^b="<<setfill('0')<<setw(8)<<s9<<endl;
    	cout<<"a<<2 ="<<setfill('0')<<setw(8)<<s7<<endl;
    	cout<<"b>>3= "<<setfill('0')<<setw(8)<<s8<<endl;
    }
    

    thanks anyway!!
  4. In Topic: binary calculator problem

    Posted 13 Aug 2013

    made following changes after line 39:
    cout<<"a & b=";
    cout.fill('0');
    cout.width(8);
    cout<<right<< s3<<endl;
    cout<<"a|b= "<<s4<<endl;
    
    

    its working as expected. i however wanted to know is there any shorter way out!!
  5. In Topic: binary calculator problem

    Posted 13 Aug 2013

    here is my output:
    enter decimal number a:
    5
    enter decimal number b:
    8
    a= 5in binary is 101
    b= 8in binary is 1000
    a & b=0
    a|b= 1
    ~a =11111010
    ~b =11110111
    a^b=1101
    a<<2 =10100
    b>>3= 0

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

cniper has no profile comments yet. Why not say hello?