UDP port program - Where to start

Write your question here.
I am a newbie. I am trying to learn how to program. I have read some books but I am still lost. A little direction or help is much appreciated!

I am looking to code a simple program that will ask for a user to input a UDP port number to listen on, open that port, copy what is received into a variable, and then print that variable to the screen. I do not know where to start with the port code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  // What library should I include?
#include <stdio.h>
#include <iostream.h>

int main()
  int udpPort;
  string udpVariable;
     //Ask for the port number
     cout << "Enter the UDP port to listen on: ";
     cin >> udpPort;

    // Open the udpPort
    This is where I am lost!

    // Listen to the udp port and copy what you hear into a variable
    cin >> udpVariable;


    // Output what was heard to the screen
    cout << udpVariable;
c++ doesn't have networking capabilities. So you would need an external library.
After doing some searching I have found a number of c++ networking libraries. Should I just use the boost libraries or does anyone have a recommendation?

I have also found the forum threads about adding a library. Seems like greek to me but I am going to give it a shot!
Topic archived. No new replies allowed.