Problems calling this function
Ive been trying to learn C++ for over two weeks now hoping to get into win32 api's soon but simple ........ is stumping me. I know all about data types and basic stuff but I just dont seem to get it? idk my code looks alright i though I didnt organize it here thats not what im worryin about I was wondering is this the best way to write this function?
Code:
// xwxw.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
void getnumber();
using namespace std;
int number;
int main()
{
cout<<"Give me the number:";
cin>> number;
getnumber();
cin.get();
cin.ignore();
}
void getnumber()
{
int x = 5;
int b = number;
while (x < b) {
cout<< x<<endl;
x++;
}
cin.get();
cin.ignore();
}