-1

enter image description here

1.After executing a.exe is not showing output in visual studio terminal and also in powershell admin mode.It is also not giving any error.

but when running hello world program it gives output.

#include <iostream> 
#include <vector> 

using namespace std; 

int main() 
{ 
    vector<int> g1; 

    for (int i = 1; i <= 5; i++) 
        g1.push_back(i); 

    cout << "Output of begin and end: "; 
    for (auto i = g1.begin(); i != g1.end(); ++i) 
        cout << *i << " "; 
    return 0; 
}
  • 1
    Post your actual source code. Don't post pictures of your code. Read about [mcve] – selbie Oct 25 '19 at 19:12
  • Perhaps you over minimized or need to better explain your expectations. [I am getting reasonable output.](https://ideone.com/XlqPd3) – user4581301 Oct 25 '19 at 19:36

2 Answers2

0

Your code is showing but it just exits out so fast you can't tell what it returned. Advise checking this out: How to stop C++ console application from exiting immediately?

0

Have you set the program to the console program? Property -> Linker -> System -> Subsystem -> "Console(/SUBSYSTEM:CONSOLE)"

enter image description here enter image description here

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20