can anybody make from this line an variabel (long or char variable or both)
std::cout << "\n0x" << std::string << newCrc << std::endl;
please help..
whole code hier
Printable View
can anybody make from this line an variabel (long or char variable or both)
std::cout << "\n0x" << std::string << newCrc << std::endl;
please help..
whole code hier
I'm not sure I get the code. Sorry.....
You are going to have to be more specific. Are you trying to take the entire line you're printing and turn it into a string?
yes shkuey the entire line must be converted to a string, can you help?
greetz
You can use .c_str() to convert a variable to a character string.
Is this the kind of thing you're after:
Code:#include<iostream>
#include<string>
#include<sstream>
using namespace std;
string itos(int i) // convert int to string
{
stringstream s;
s << i;
return s.str();
}
wtf is this? I've never seen a class decleration inside another class in C++. Is this standard ISO C++? I've done this myself in Java, but in my experience you should be carfeful what you put inside a class/struct in C++. Oh well, guess this option passed me by. :)Quote:
class FastCrc: public Crc
{
public:
FastCrc (Crc::Type key)
: Crc (key)
{
_table.Init (key);
}
void PutByte (unsigned byte);
private:
class Table
{
public:
Table () : _key (0) {}
void Init (Crc::Type key);
Crc::Type operator [] (unsigned i)
{
return _table [i];
}
private:
Crc::Type _table [256];
Crc::Type _key;
};
private:
static Table _table;
};
yes i think this isn't the ISO c++ standars but it's work
greetz