City View

City viewscapes but this is default view

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Thursday, November 22, 2012

Accessing C++ codes from C codes

C and C++ are close cousins but I have never tried mixing both codes in one project before. I encountered such a need to mix codes just recently due to work. It is quite difficult to scour the net for reference. And after long hours of experimentation I was able to access C++ codes in my C codes.
Here are the steps:


C main file:
Call the C++ interface

void the_cpp_interface();
C++ header file:
Define wrapper and class:
#ifdef __cplusplus 
extern “C” { void the_cpp_interface()};
 #endif

class cppClass
{
 Public:
                Void cppTestFunc();
                cppClass() {};
}
               
C++ source file:
extern “C” void the_cpp_interface()
{
                //your c++ codes here
}

//class defn
myClass::cppTestFunc()
{
             // codes here
}

Sunday, November 11, 2012

Hello World!


My first trash code... enjoy :)

#include <conio.h>
#include <stdio.h>

int main()
{
    printf("Hello World!");
    return 0;
}