Singly linked list class I have created this program about using a singly linked list class that implements several functions: Add, Display and Sort.

Could you suggest me how to make my code better and which functions to include in the future?

#include &lt;iostream&gt;
using namespace std;
// ----------------------------------------------------
class Node {
private:
    int value;
    Node *next;
public:
    Node(int v) { value = v; next = NULL; }
    void Add(int v);
    void Print();
    void SortValues();
    void SortNodes();
};
// ----------------------------------------------------
void Node::Add(int v)
{
    Node *newItem = new Node(v);
    Node *temp = this;
    while (temp-&gt;next != NULL)
        temp = temp-&gt;next;
    temp-&gt;next = newItem;
}
void Node::Print()
{
    Node *temp = this;
    while (temp != NULL)
    {
        cout &lt;&lt; "  " &lt;&lt; temp &lt;&lt; " : " &lt;&lt; temp-&gt;value &lt;&lt; endl;
        temp = temp-&gt;next;
    }
}
void Node::SortValues()
{ 
    Node *swapCandidate = next;
    Node *current;
    Node *min;
    //    L* temp;
    // Look at every value
    while (swapCandidate != NULL)
    {
        current = swapCandidate;
        min = swapCandidate;
        // ------------------------------
        while (current != NULL)
        {
            if (current-&gt;value &lt; min-&gt;value)
            {
                min = current;
            }
            current = current-&gt;next;
        }
            if(min != swapCandidate)
            {
                int tempV = min-&gt;value;
                min-&gt;value = swapCandidate-&gt;value;
                swapCandidate-&gt;value = tempV;
            }
         // ------------------------------
         swapCandidate = swapCandidate-&gt;next;
         }
     }
     // ----------------------------------------------------
void main()
{
// Sort - moving values
Node *myList = new Node(0);
myList-&gt;Add(15);
myList-&gt;Add(3);
myList-&gt;Add(20);
myList-&gt;Add(1);
myList-&gt;Print();
myList-&gt;SortValues();
cout &lt;&lt; "------------------------------" &lt;&lt; endl;
    myList-&gt;Print();
system("pause");
}
Don't use using namespace std;

It's bad practice that can cause a lot of problems that are easy to avoid, most people are used to the prefix, and three letters aren't that hard to type.



Don't use system("pause")

It's not portable and there are better ways to hold the console open. 



Prefer nullptr to NULL

NULL is a macro that will be silently converted to 0 whenever possible. nullptr is a language extension and will only work contextually with pointers.



Use proper encapsulation

A linked list should be a class that acts as a container of Nodes. Your Node class should not know how to sort all Nodes. This is the job of the container. Furthermore Nodes are an implementation detail that should not be exposed to the user.

class LinkedList
{
public:
    // user functions should go here
private:
    struct Node
    {
        int value;
        Node* next{ nullptr };
    }
}


A few things to note. 


I put the public section first. This way anyone reading the code
will know what functions and variables are available to them.
I used struct for the Node since it represents plain data. It is
also easier to use because struct is default public so the
LinkedList will be able to access it easily (But since it is
properly encapsulated inside the container nothing else can.)
I initialized new nodes to nullptr.




Printing and Sorting aren't typically done as member functions. They should be standalone functions that accept a container, or a range of a container to perform their tasks.



Use RAII whenever possible

You shouldn't be manually allocating memory. Especially since you aren't freeing it. Every instance of new should come with an instance of delete but you shouldn't be using them at all.



Prefer '\n' to std::endl

std::endl does more than just move to the next line. It is generally preferred not to use it casually.



Keep working on it. Try to implement the container with some of the member functions found at std::list. Browse The Core Guidelines from time to time. And bring us more code to review.