B
Bernhard Hidding
Hello,
I want to combine a string with an integer. I work on SuSE 9.1 with g++. Why
does this piece of code not work?
#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include <string>
....
intvar intg = 0;
std::string arraystring = "array" + intvar +".dat";
....
g++ gives the following error message:
error: invalid operands of types `const char*' and `const char[5]' to binary
`operator+'
Thanks for your help,
Bernhard
I want to combine a string with an integer. I work on SuSE 9.1 with g++. Why
does this piece of code not work?
#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include <string>
....
intvar intg = 0;
std::string arraystring = "array" + intvar +".dat";
....
g++ gives the following error message:
error: invalid operands of types `const char*' and `const char[5]' to binary
`operator+'
Thanks for your help,
Bernhard