Hope someone can tell me how to convert from double, long and int to a string of a specified length. I also need to to pad the string with zeros.
Type: Posts; User: mangoMan
Hope someone can tell me how to convert from double, long and int to a string of a specified length. I also need to to pad the string with zeros.
Yes the name does fit and it is not a buffer overrun problem.
Someone at work suggested that I might be missing the copy constructor. So I created one and I think that might be the problem but I...
This is serious stuff guys. Here is what I am working with.....
I wrote the IString class and it works when tested but when this other guy uses my class for two of his applications the one...
elad, thanks for the response. It works now! You were correct.
I have created an IString class that wraps around stl string. When I test my classes + operator this is what I get:
IString sEdc= "Freddy Flinty";
sEdc = "'" + sEdc + "'";
cout<< "sEdc =" <<...
Kip,
I appreciate your help. But the problem is that I am working with old code that cannot be changed. I am removing an old IString class, provided by the IBM open class library, and replacing it...
Kip,
I don't want to to do that. I want to be able to call it with the objects.
Speedy5,
Thanks for the response. I think you are wrong but I can't tell you why because if I knew I would have been able to solve my problem. I have seen the following call work before:
...
As per popular demand here it is:
The stripped version of my IString class:
///////////////////////////////////////////////////////////////////////
// istring.hpp...
Mr. XSquared,
I want to be able to call sprintf like this:
sprintf(buffer, "hello %s and %s", str1, str2);
so why are you telling me to write another function that returns a char*. All I am...
Thanks for your response but why should I have to add '()' to the end of the variable.
How do I default the conversion of an IString object to char*?
I want to be able to call sprintf like...
Thanks for the response but it does not help me. I know what you just stated. What I am asking is:
How do I default the conversion of an IString object to char*?
I want to be able to call...
If I have function that accepts any type like the formatting function sprintf. I have a bunch of conversion operators for my IString class how do I make sure that when I call sprintf only the char*...
Hello All,
This is the code that does not work properly:
char dbszSQL[1024];
IString theStartDate("2004-01-01-00.00.00.000000"), theEndDate("2005-01-01-00.00.00.000000");
Here is what my operator looks like:
istring.hpp
---------------
operator char*() const;
Thanks for the idea but what do I do with the string being used in the constructor in the header file:
IString::IString(string s)
because this is going to require '#include<string>' in the...
I am trying to wrap an old library using STL so we don't have to change all the 50 applications to use STL. The old library used the IString class so here is what my test wrapper class looks like but...
Yes I did switch to the new C headers but that did not solve the problem.
Hello Everyone,
I compile the following file, mydate.cpp, and get these errors:
idun:/h/odin/IOCDir/IDate >make
/usr/vacpp/bin/xlC_r -c -qsource -qlistopt -qxref -qattr...