G
Guest
arrayStr and intString are both failing a C2061 error
// median.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string arrayStr = "";
string intString = "";
cout << "Enter an array of integers" << endl;
do
cin >> intString;
C2061 arrayStr = arrayStr + intString + " ";
C2061 while intString != "";
cout << arrayStr << endl;
return 0;
}
A better question would be how do I enter a string of numbers separated by
spaces? I need a variable length array of integers.
And, why has Studio.NET stopped "Please press any key to continue" in the
command prompt window?
I haven't done C++ programming in a while and I'm having more trouble than I
ever had when I was first learning.
// median.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string arrayStr = "";
string intString = "";
cout << "Enter an array of integers" << endl;
do
cin >> intString;
C2061 arrayStr = arrayStr + intString + " ";
C2061 while intString != "";
cout << arrayStr << endl;
return 0;
}
A better question would be how do I enter a string of numbers separated by
spaces? I need a variable length array of integers.
And, why has Studio.NET stopped "Please press any key to continue" in the
command prompt window?
I haven't done C++ programming in a while and I'm having more trouble than I
ever had when I was first learning.