Hi.
VP has been a great app for modelling and generating java during University and now its my chance to try the c++ features.
The first problem I’ve come across is how to model procedural bits of c++ such as main() or dllmain(), and preprocessor stuff like #include or #define.
These can be rounded up by finding a good way to make a simple c++ hello world app. What I would like to make is:
------------------------file:helloWorld1.cpp-------------------
#include <iostream>
using namespace std;
void main(){
cout << "hello world!";
}
But the closest I have gotten so far is below, and this is generated from a simple class diagram:
------------------file:helloWorld2.h-----------------
#include <string>
#include <vector>
#include <exception>
using namespace std;
#ifndef __helloWorld2_h__
#define __helloWorld2_h__
class helloWorld2;
class helloWorld2
{
public: void main();
};
#endif
---------------------file:helloWorld2.cpp---------------
#include <string>
#include <vector>
#include <exception>
using namespace std;
#include "helloWorld2.h"
void helloWorld2::main() {
cout << "hello world!";
}
My question is, how to model main() in VP so that when I do VP->tools->instant generator->c+±>generate the code looks like helloWorld1.cpp