Browsing all articles in sample programme

Why variables can not be declared in a switch statement just after labels?

see this code

int main()
   int i=1;
       case 1: int x=10;
               printf(" x is %d",x);
    return 0;

Do you think this code will compile? if yes then you need to read this post….

read more


How can i detect Windows or Linux in C,C++ programming?


Sometimes we need to write platform independent  code which works in windows and linux machine without giving any flag or any modification in code or make file manually.

So in such case i usually use compiler generated macro to check the platform .


In Linux all c and c++ compiler define macro like  linux, In Windows all c and c++ compiler define macro like _WIN32 

so we can use this macro to separate code for linux and windows see belows example code

read more


Huffman Encoding Using Linked List with Source Code

Author saurabh    Category c, sample programme     Tags

After a long time, I am back. Months without programming and then finally I got some time on my hands. So I set out to code the Huffman’s Data Compression Algorithm. And the result is here!

The code is well-commented and I hav given some additional documentation. Also, I hav tested it extensively – right from small words to complete bollywood Songs..:P

Here i had did two types of Huffman Encoding

1 ) Simple User Input

2) Take Input from File

But if there are any probs,let me know.

read more

Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

Find us on Facebook

Find us on stackoverflow


Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link