extern "C" {
#include <zephyr.h>
#include <sys/printk.h>
#include <stdio.h>
}

/**** 1. Demonstration On dynamic allocation  ****/
class Sample
{
  Sample* cPtr;
  public:
  Sample()
  {
    printf("ctor called \n");
    cPtr = new Sample();
  }
  
  ~Sample()
  {
    printf("dtor called \n");
    delete cPtr;
    cPtr = nullptr;
  }

};

/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

void main(void)
{
        printf("Hello... \n");
	printk("Hello World! %s\n", CONFIG_BOARD);
}


/**** 2.Demonstration on operator overloading ****/
// class Sample
//{
//  public:
//  int val;
//  Sample(int copy)
//  {
//    val = copy;
//  }
//  Sample& operator=(const Sample& rhs)
//  {
//    val = rhs.val;
//    return *this;
//  }
//};


//int main(void)
//{
//  int temp = 5;
//  int var = 0;

//  Sample obj(temp);
//  Sample sObj(var);
//  printf("%d org obj, %d copied obj \n",&obj.val, &sObj.val);

//  sObj = obj;

//  return temp;
//}

/**** 3. Demonstration On Inheritance Data relations  ****/



/**** 4. Demonstration On C++ typecasting limitations and other possible limitations  ****/
//class Sample
//{
//  public:
//  Sample();
//  int x = 9, y = 0;
//  void p;
//  void* temp_ptr = reinterpret_cast<void*>( p );
//};

//int main(void)
//{
//  int temp = 5;

//  return temp;
//}


