Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » #include <array> (when using C++11 code array<double, int > shows array unresolved error??)
icon9.gif  #include <array> [message #1084547] Sun, 11 August 2013 18:56 Go to next message
Jack Kowalski is currently offline Jack KowalskiFriend
Messages: 5
Registered: August 2013
Junior Member
Mad

I added the compiler flag -std=c++11, and -gnu=c++11 but I get can not resolve the line of sample code array<double, 5> rain;

what else do I need to set to include c++11??, thanks.

sample code below, btw the double rain[5]; works just fine.... I know its the set up can you help get me to the correct doc or settings example, I love the Eclipse, just need to learn how to use it.

Ubuntu 12.04
gcc 4.7
g++ 4.7
gnu 4.7

my sample code below:::


#include <iostream>
#include <string>
#include <array> ////// <<<<<<<<<< this is ok


using namespace std;


void PrintArray(double[], int size);
void inputArray(double aray[], int size);


int main()
{


// double rain[5]; //////////// <<<<<<<<<<<<<<< this is ok
array <double, 5> rain; // <<<< ERRROR is here, cant resolve array-- WT

rain[0] = 33.0;
rain[1] = 33.1;
rain[2] = 33.2;
rain[3] = 33.3;
rain[4] = 33.4;


PrintArray(rain, 5);
inputArray(rain,5);
PrintArray(rain, 5);

return 0;
}

void PrintArray(double aray[], int size)
{

for(int i = 0; i < size; i++)
{
cout << endl << "these are the current rain array entries = "<< aray[i];
}
}


void inputArray(double aray[], int size)
{

for(int i = 0; i < size; i++)
{
cout << endl << "enter a value to fill the array "<< endl;
cin >> aray[i];
}


}

Re: #include &lt;array&gt; [message #1084555 is a reply to message #1084547] Sun, 11 August 2013 19:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Jack,

It's best to ask about C++ things on the CDT forum.

On 11/08/2013 8:56 PM, Jack Kowalski wrote:
> :x
> I added the compiler flag -std=c++11, and -gnu=c++11 but I get can not
> resolve the line of sample code array<double, 5> rain;
>
> what else do I need to set to include c++11??, thanks.
> sample code below, btw the double rain[5]; works just fine.... I know
> its the set up can you help get me to the correct doc or settings
> example, I love the Eclipse, just need to learn how to use it.
>
> Ubuntu 12.04
> gcc 4.7
> g++ 4.7
> gnu 4.7
>
> my sample code below:::
>
>
> #include <iostream>
> #include <string>
> #include <array> ////// <<<<<<<<<< this is ok
>
>
> using namespace std;
>
>
> void PrintArray(double[], int size);
> void inputArray(double aray[], int size);
>
>
> int main()
> {
>
>
> // double rain[5]; //////////// <<<<<<<<<<<<<<< this is ok
> array <double, 5> rain; // <<<< ERRROR is here, cant resolve
> array-- WT
>
> rain[0] = 33.0;
> rain[1] = 33.1;
> rain[2] = 33.2;
> rain[3] = 33.3;
> rain[4] = 33.4;
>
>
> PrintArray(rain, 5);
> inputArray(rain,5);
> PrintArray(rain, 5);
>
> return 0;
> }
>
> void PrintArray(double aray[], int size)
> {
>
> for(int i = 0; i < size; i++)
> {
> cout << endl << "these are the current rain array entries =
> "<< aray[i];
> }
> }
>
>
> void inputArray(double aray[], int size)
> {
>
> for(int i = 0; i < size; i++)
> {
> cout << endl << "enter a value to fill the array "<< endl;
> cin >> aray[i];
> }
>
>
> }
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: #include &lt;array&gt; [message #1084590 is a reply to message #1084555] Sun, 11 August 2013 20:33 Go to previous messageGo to next message
Jack Kowalski is currently offline Jack KowalskiFriend
Messages: 5
Registered: August 2013
Junior Member
I thought I was asking the correctly forum, sorry where should I post?? thanks.
Re: #include &amp;lt;array&amp;gt; [message #1084845 is a reply to message #1084590] Mon, 12 August 2013 06:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Jack,

Posting here wasn't wrong, it's just more likely you'll get specific
help for a C/C++ related from the CDT project and you can fine their
support link from their home page: http://www.eclipse.org/cdt/

On 11/08/2013 10:33 PM, Jack Kowalski wrote:
> I thought I was asking the correctly forum, sorry where should I
> post?? thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to solve Eclipse Error
Next Topic:Autosave like Google Docs
Goto Forum:
  


Current Time: Fri Mar 29 12:55:53 GMT 2024

Powered by FUDForum. Page generated in 0.03970 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top