Message from C, C++ discussions

January 2020

— Ok sorry


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
vector<int> v;
for(int i:v){

— What will be it's output?

— Why i'm getting garbage value?

— 10

— Why did you ask?

— What kind of value?
try to add separators between the values

cout << i << "\n";

cout << i << " ";

Message permanent page

— Ah wait, there's only one

— Then I have no idea, looks fine

— I'm getting garbage values, why so?

— Hey guys any one having good channel to learn Java or python??

— Is it the full program that you run, or you removed some parts?