If you still want to use your char array you must make it dynamic otherwise your compiler expects a constant.
For example:
cin >> N;
char** mat = new char*[N];
for(int i=0;i<N;i++)
...
Type: Posts; User: jlf029
If you still want to use your char array you must make it dynamic otherwise your compiler expects a constant.
For example:
cin >> N;
char** mat = new char*[N];
for(int i=0;i<N;i++)
...
while (fin>>val)
{
sum = sum + val;
count++;
}
I think this shouold work
something like:
if(argc!=2) {
cout << "Wrong arguments specified\n";
exit(0);
}
Maybe you can cast it?
char boss=((char)(boss_beaten+1));//where boss_beaten is a int
why not just store it as a binary file?
if you are using char[] arrays, you can simply swap the elements
i use quincy 2005 cos its simple and it gets the job done. I like freesing f9 to compile. It's better than command lining.
your sum should also be a double!
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main ()
thirdly
else if (num marray.a[mid])
this wont even compile
firstly
while (low = high)
should be low==high
we were always taught to use eof by reading the first value in before the eof loop. You can always use eof and in the loop check for if(var.fail()) break;
use if statements with the cstring function strcmp
use setprecision(2) with cout and include <iomanip>
eg
int x = 2.143234234;
cout << setprecision(2) << x << endl;
dont use ios::binary leave that parameter out then try cin.getline(tbuffer);
what is testnum ? You are always have it set to 0
Have you tried learning them?
You are saying that each class has its own print function, you could call the superclass print function by saying Base::PrintData();
lol, nothing wrong
constructors dont have return types
You mean its actual source code??
if so just read in char by char with cin.get(ch); and open the file as
ifstream fin(__FILE__);
im so lost.
Ok, I've got my stack class I made, but as you know if I push 1,2,3 in a stack i would expect 3 to get popped out first right?
Mine doesn't!!! What's wrong?
template <class T>
class List...
yup he's right
You cant put variables in arrays unless they are constants.
const int SIZE = 10;
int array[SIZE][SIZE];
or dynamically
int **matrix;
int n;
matrix = new int*[n];
for(int i=0;i<n;i++)
You can only have constants for array sizes, they can't be variable.
You will have to use dynamic memory.
int n;
int *matrix;
cout<<"Please enter how many integers per line [ 1 <...