Stack Exchange
expected constructor, destructor, or type conversion before ‘*’
//node.h

#ifndef NODE_H
#define NODE_H

class Node {

  public:
    int key;
    Node *next;
    void add(int key);
    void print();
    Node();
    Node(int key);
    Node *bubble();
    Node *swap(Node *x, Node *y);
};

#endif

//NodeSort.cpp

#include <iostream>
#include <cstdlib>
#include "node.h"

namespace node{

struct node{
  int key;
  struct node *next;
};

DNode *DNode::bubble(){              //This is where the error is.
  struct node *pos = head;
  while(pos->next !=  NULL){
    if(pos->key > pos->next->key)
      swap(pos,pos->next);
  pos=pos->next;
  }
}

void DNode::swap(Node *x,Node *y){
  node *temp = x->key;
  x->key     = y->key;
  y->key     = temp;
}

int main(){
  struct node *head;
  init(&head);
  add(head,2);
  add(head,3);
  add(head,5);
  bubble(head);
  print(head);
 }
}

The goal of NodeSort.cpp is to bubble-sort a linked list (or double linked list??) and return the new head. So as you can see from the title, that's one error I am getting from NodeSort.cpp. The compiler is also showing I am missing a brace somehow. 
*Note: The functions "bubble" and "swap" is how my instructor wants to name it. In all honesty, I don't know what the DNode would represent besides a new class perhaps or header file? The functions in Node.h are defined in a different file called main.cpp.

You're trying to implement two member functions of DNode but that class isn't defined anywhere?

can you try to make a small reproducible program to show us the error

So should I just completely make a new header file or class labeled as DNode?

@Taesian You have an undeclared DNode class, a struct node and a Node class, so you have three(incomplete) node classes, just pick one
