title: C/C++ implementation of a Directed Acyclic Graph
body: <p>As novice,  I m trying to generate a DAG with C (or C++). </p>
  
  <pre><code>struct Node
  {
      Link *incomingEdge, *outgoingEdge;
  };
  
  struct Link
  {
  
      Node *origin, *destination;
  
  };
  </code></pre>
  
  <p>simply in my code there are only one incoming and outgoing edges for each node. However, a node could have several incident edges. Moreover, number of incident edges might change for each node.</p>
  
  <p>how can I generate different number of pointers for each node ?</p>
  
  <p>assume that I have; </p>
  
  <p>nodeA with 5 incoming edges and 4 outgoing edges.
  nodeB with 3 incoming edges and 6 outgoing edges.</p>
  
  <p>so number of pointers are changing for each node.</p>