November 9th, 2012 04:51 AM
There is another problem with your code.
EOF is usually defined as the int -1. If you assign it to a char then the value will be truncated and the test will never be true.
BTW that is the reason...
August 31st, 2012 01:52 PM
Trouble is that in the original code m_var is a reference to string.
I got it to compile without errors with g++ 4.6.3
but somehow that feels wrong
#include <iostream>
#include <string>...
August 29th, 2012 04:04 PM
You have bufferoverflows in your bubblesort.
And please use CODE tags when posting code.
Kurt
August 15th, 2012 02:37 PM
remove it. It always returns true.
But I could imagine that the original intent was to check for non empty words.
if ( word > "" )
would be the same as
if ( !word.empty() )
Kurt
August 13th, 2012 05:43 AM
How is the function called sf_open or sfopen ?
Kurt
August 12th, 2012 06:37 AM
It depends on the way you want to use your class. e.g. if you want to add objects of your class into a standard container then it is needed.
That has nothing to do with the existence of a default...
August 11th, 2012 05:42 AM
Show a minimal code example that shows the same error.
Kurt
August 8th, 2012 02:48 AM
The operators < and > of GreedyObject and MNode should be declared const.
Also you have to #include <ctime> and <cstring>
Kurt
August 6th, 2012 04:33 PM
C_IADS_TCP_Manager *mp_IADS_TCP_Manager;
If the class is really called C_IADS_TCP_MANAGER ( all capitals ) that would explain the error message
Kurt
August 6th, 2012 06:19 AM
person::getsalary() doesn't return anything ( it should if I look at the declaration ) and it seems to be implemented as pure input function.
Kurt
August 5th, 2012 02:10 PM
There is one thing that has not been stated clearly when talking about the difference between copy constructor and assignement operator.
The assignement operator has to release any resorces that the...
August 5th, 2012 04:27 AM
Is this what you try to do ?
#include <iostream>
#include <string>
using namespace std;
struct clientdata
{
string vClientName;
August 3rd, 2012 03:03 PM
a 4 byte float ( single precision ) has only about 7 significant decimal digits.
so you can only expect a float and a double to be same for 7 digits.
if you need more precicion you have to use...
August 3rd, 2012 02:44 PM
Not true. '\n' is whitspace and the streamextractor for an int skips leading whitspaces by default.
Kurt
August 3rd, 2012 08:34 AM
I'd add some output statements
e.g.
int x = 0, y = 0, z = 0;
ifstream data("blah.txt");
while( data >> x >> y >> z)
{
std::cout << "x:" << x << " y:" << y << " z:" << z << std::endl;
...
August 3rd, 2012 08:04 AM
First of all you should check for a successfu read.
Seems that reading fails and that's why you get an infinite loop.
try something like this
int x = 0, y = 0, z = 0;
ifstream data("blah.txt");...