"Fossies" - the Fresh Open Source Software Archive

Member "FunctionCheck-3.2.0/test/simple_test_cpp.cpp" (26 May 2012, 713 Bytes) of package /linux/privat/old/FunctionCheck-3.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <stdio.h>
    2 #include <stdlib.h>
    3 
    4 /* this file is a small C++ program with a global object.
    5    it is used to test problems related to constructors/destructors
    6    in C++ programs, which are called resp. before and after
    7    main() (it is enoying for me, because I need to detected
    8    the REAL end of the program.                                    */
    9 
   10 class Yannick
   11 {
   12     int a, b, c;
   13     char *t;
   14 public:
   15     Yannick(void);
   16     ~Yannick();
   17 } global_object;
   18 
   19 int i = 0;
   20 
   21 Yannick::Yannick(void)
   22 {
   23     printf("cnst\n");
   24     a = 0;
   25     b = 1;
   26     c = 2;
   27 
   28     t = (char *) malloc(100);
   29 }
   30 
   31 Yannick::~Yannick(void)
   32 {
   33     free(t);
   34     printf("~\n");
   35 }
   36 
   37 int main(void)
   38 {
   39     printf("hello world!\n");
   40     return 0;
   41 }