[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem : Don't create global static class



Hello I'm student in Korea
I'm testing next example.
I think that this example print next line in console.->
"   I'm in class constructor 
    test point
    I'm in class destructor "

but this example print console that-->
"
   test point
   I'm in class destructor "

Reason : RTEMS don't create global static class 
I don't  know this reason and don't solve it.
Teach Me 
Thank you

example source code :
--------------------------------------------
#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
extern "C" {
extern rtems_task main_task(rtems_task_argument);
}
class A {
public:
    A(void)   { printf("\nI'm in class constructor \n"); };
    test(void)  { printf("test point  \n");   }
    virtual ~A() { printf("\nI'm in class destructor \n"); };
};
 
static  A king;
 
void
test_main(void)
{ 
    king.test();
}

rtems_task main_task( rtems_task_argument )
{
    test_main();
    exit(0);
}
-------------------------------------------------------
 
 
/*------------------------------------------
  Lee Young Ki
  king at syscon.soongsil.ac.kr
-------------------------------------------*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rtems.rtems.org/pipermail/rtems-users/attachments/19990528/b35eb2cd/attachment.html