There are no errors showing for this but for some reason just after I enter the integer from the cin
the window closes ignoring my answer, which should determine if it says "No that isn't my fav number" or continue to a function.
Here is my code:
#include <iostream>
using namespace std;
void printSomething(int x); //Called Prototyping, means that you don't have to have the function on top.
int main() {
cout << "Yo,\n";
int a = 16;
int b = 12;
int y;
if(a > b) {
cout << "Opening Function.\n";
cout << "\nWhat is my fav number, I forgot: ";
cin >> y;
if(y == 10) { //If my fav number is 10 then continue.
printSomething(y); //Calls the function. (y) is the interger called at (int x)
}
else {
cout << "No that isn't my fav number";
}
}
}
void printSomething(int x) { //This is the function.
cout << "\nHey! I am the function!\n#########" << endl;
cout << "I iz lonely.";
cin.get(); //Meant to keep the terminal open.
}
This is the output:
'Things.exe' (Win32): Loaded 'C:\Users\Matt\Documents\Visual Studio 2015\Projects\Things\Debug\Things.exe'. Symbols loaded.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'Things.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
The thread 0x2410 has exited with code -1073741510 (0xc000013a).
The thread 0x12a8 has exited with code -1073741510 (0xc000013a).
The thread 0x2b18 has exited with code -1073741510 (0xc000013a).
The thread 0x264c has exited with code -1073741749 (0xc000004b).
The program '[92] Things.exe' has exited with code -1073741510 (0xc000013a).