Skip to content

Instantly share code, notes, and snippets.

@vividvilla
Created January 26, 2013 09:21
Show Gist options
  • Save vividvilla/4641268 to your computer and use it in GitHub Desktop.
Save vividvilla/4641268 to your computer and use it in GitHub Desktop.
Program to find your system type (32bit || 64bit) - http://vivek.techiestuffs.com/2012/find-your-operating-system-32bit-64bit/
//Program to find the type of operating system 32bit or 64 bit
#include<stdio.h>
void findit(char s[]) // Function which accepts array of characters(String)
{
int a=sizeof(s); // Finding the size of s[] which is a pointer
if(a==4) // checking whether a is 4byte
printf(" 32bit system\n");
elseif(a==8) //checking whether a is 8 byte
printf("64bit system \n");
else
printf("WTF !!!! \n"); // If above two condition doesn't satisfy then print this line.
}
void main()
{
findit("a"); // passing "a" to the function findit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment