Need Help
Jul 20, 2015 at 8:52pm UTC
I need help, I'm pretty new to C++, and I have an issue with this code, after I answer "Y" the cout text from int extra() doesn't show up in the console application. Also I want to know how to make it open the link automatically.
Thanks,
-jacem49
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <fstream>
#include <iostream>
using namespace std;
int extra()
{
int extra2;
extra2 = 1;
cout << "Access Granted " << endl;
cout << "http://www.google.com/ " << endl;
return (0);
}
int main()
{
int main2;
char answer;
cout << "Test Line 1 " << endl;
cout << "Test Line 2 " << endl;
cout << "Test Line 3 " << endl;
cout << "Test Line 4 " << endl;
cout << "Test Line 5 " << endl;
cout << "(Y/N): " ;
cin >> answer;
if (answer == 'N' ) {
main2 = 0;
cout << "Access has been " << endl;
cout << "DENIED. " << endl;
}
if (answer == 'n' ) {
main2 = 0;
cout << "Access has been " << endl;
cout << "DENIED. " << endl;
}
if (answer == 'y' ) {
main2 = 1;
extra;
}
else
if (answer == 'Y' ) {
main2 = 1;
extra;
}
cin.get();
cin.get();
return (0);
}
Last edited on Jul 20, 2015 at 8:52pm UTC
Jul 20, 2015 at 9:25pm UTC
extra; should be extra();
Jul 20, 2015 at 10:38pm UTC
I feel stupid for overlooking that, thank you.
Topic archived. No new replies allowed.