#Compile and run with VScode help

29 messages · Page 1 of 1 (latest)

frozen moss
#

Sup guys

pale portalBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

half pollen
#

?

frozen moss
#

Hi guys

#

I just needed some help on something regarding running the code on C++

#

When I run it on VScoce a bar at the top appears with 3 options

#

I picked one of them

#

it is called clang

half pollen
frozen moss
pale portalBOT
#

@frozen moss Has your question been resolved? If so, type !solved :)

frozen moss
#

Not yet

#
#include <iostream>
#include <list>
#include<string>
using namespace std;
int main(){
    int banana[5] = {1,2,3,4,5};

    for (int i; i < 5; i++){
        cout<< banana[i];
    }
}```
#

Why is it highlighted yellow

#

@half pollen

#

nvm I got that fixed

remote plume
#

you need to properly initialize your intergers

fallen nexus
#

int i=0

frozen moss
#

it iterates through eachone

#

and it would return 12345

remote plume
#

since it's not initialized it could be -3976

#

you need to explicitly initialize intergers for them to have a well defined value

frozen moss
#

Yea I fixed tha

#

that