Browsing all articles in c++
Apr
27

Difference between c and c++ and java programming languages

Author JIGAR PATEL    Category c++, tips     Tags

In last 2 yeas i have worked a lot on C Programming But now days i need to work on C++ and Java programming language. I have not time to take book of C++ or java programming and start to read that…In any programming language most of the stuff are common. So you know one language very well then by keeping that in mind you can learn other language very well.

Some days ago i found this article and it helped me a lot. i  hope this will also help you….

C++ Style Languages: C++, Objective C, Java, C#

  • it shows the hello world program , version checks,used libraries,
  • primitive  data types,
  • arithmetic and logical operation
  • arrays and strings,
  • regular expressions,
  • dates and time,
  • functions declaration ,
  • execution control flow,
  • files operatins,
  • processes and environment,
  • libraries and namespaces
  • concept of objects

read more

Jan
28

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

see this code

#include<stdio.h>
int main()
{
   int i=1;
   switch(i)
   {
       case 1: int x=10;
               printf(" x is %d",x);
       break;
    }
    return 0;
}

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

read more

Jan
5

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

Dec
25

Most common directory layout seen in all C/C++ based Project/Package/Library

Author JIGAR PATEL    Category c, c++, projects, projects, Tips, tips     Tags

I have been with lots of projects package or library written in C or C++ programming language has One common directory layout. So if you planning to design any new package /project/library in C or C++ programming language then this will really help you to design directory layout of your project.

read more

Nov
19

How can i use GCC in windows/cmd just like using gcc in linux terminal?

At work i use gcc in linux but at home i use windows so i need to figure out the way of using gcc in cmd of windows just like using gcc in linux terminal. Since i dont like to use IDE such eclipse and neatbeans.

i came to know three option

1> Use Cygwin package

2> Use MinGW

3> Use MSYS

 

Well among all of them i have chosen option of using Cygwin package because
 

  • Cygwin is a collection of tools which provide a Linux look and feel environment for Windows.
  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

Steps to install and configure cygwin :

read more

Oct
31

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

Oct
17

List of free C and C++ Compilers for Linux and Windows

In previous post i have written  about most famous IDE of C and C++ programming language. So here i am going to write about most famous compiler for C and C++ programming language.

 MinGW

Intel C++ -linux only

GNU GCC

Digital Mars C++

Bloodshed DEV C++

Cygwin C++

Borland C++

DJGPP

Open Watcom C/C++

Pelles C- Compiler based on LCC

LCC-Win32

see this also

Top/Best C/C++ IDE for Windows & Linux

Oct
17

Top/Best C/C++ IDE for Windows & Linux

Author JIGAR PATEL    Category c, c++, linux, Tips, tips, tips     Tags

How much time gone in project design & building logic that much time also gone in writing code So if you have better IDE then you can work faster and easily. So i am going to introduce you most famous IDE for C/C++ programming on Linux & windows.

1>Eclipse CDT (C/C++ Development Tooling)

read more

Oct
9

how can I write applications in C or C++ for Android?

Most of the people know that Development of Android Application is only done in java programming language. But Reality is that Development of Android application can be done in native languages like C & C++.

I have 3 option to do this all.

1> For doing this You need to use   Android NDK

 

read more

Oct
6

How to detect memory leakage in C program?

One more tips for c-programmer,embedded software engineers.

  • In many case you need to make sure that your programs is not going to leak any heap memory.
  • In Manny case  while debugging code you will find SEGMENTATION FAULT  and you cant debug your code ahead.

So in that all case our best friend is Valgrind 

Introduction:

The Valgrind tool suite provides a number of debugging and profiling tools that help you make your programs faster
and more correct. The most popular of these tools is called Memcheck. It can detect many memory-related errors
that are common in C and C++ programs and that can lead to crashes and unpredictable behaviour.

Download & install :

You can download this tool for For {x86,amd64,arm,ppc32,ppc64}-linux and {x86,amd64}-darwin (Mac OS X). from here.
read more

Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

36 posts
saurabh
22 posts
10 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link