News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

while loop segmentation fault

Started by multiabhay, December 26, 2014, 06:14:28 AM

Previous topic - Next topic

multiabhay

Hi guys!
I am haivng a little problem in code::blocks
here is the code:

#include <iostream>
#include <string>

using namespace std;

int main()
{

    string list[] = {"one", "two", "three"};



    int index = 0;
    while(index < 4)
    {
        cout << list[index];
        index ++;
    }



   

    return 0;
}


Getting Error : Segmentation Fault .


I am using Linux mint 17.1


ollydbg

This question is a general programing question, so it violates our forum rule. So, I suggest try ask in a suitable forum to seek help.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on December 26, 2014, 07:01:14 AM
This question is a general programing question, so it violates our forum rule. So, I suggest try ask in a suitable forum to seek help.
Topic locked therefore.
And please use code-tags (#) if you paste code in the forum.
Thank you!