Search:
Type: Posts; User: cpthk
Search:
Search took 0.03 seconds.
-
September 2nd, 2010, 04:04 PM
If I have this code:
void test(){
Map *m1 = new Map;
....
Map *m2 = new Map;
....
}
-
April 22nd, 2010, 06:18 AM
I am new to the .net programming. I am trying to create the .net project in my visual studio, but I can't seem to find it. Is it the CLR? If it is, why not just name it .net, instead to confuse...
-
September 15th, 2009, 04:17 AM
-
September 15th, 2009, 04:07 AM
Hi:
If I have code:
if(result != NULL && result.data != NULL){
...
}
-
August 31st, 2009, 02:35 AM
If I have a class:
class test{
public:
test(){
...
}
};
-
August 29th, 2009, 12:47 AM
This code is directly copied from msdn site, I did not write that
-
August 28th, 2009, 06:57 PM
I read the documentation, the
map::end()
points to the past-the-end element, not the last element of the map.
The
map::begin()
-
August 27th, 2009, 12:39 AM
I got some LNK4217 error message. I read a little documentation here: http://msdn.microsoft.com/en-us/library/aa3se25k%28VS.80%29.aspx
with example code:
// LNK4217.cpp
// compile with: /LD...
-
August 18th, 2009, 05:59 PM
sorry, I am not allowed to do that. The function is written by another library. If I change the function, there are hundred of calls I need to update.
@laserlight
could you give me a code example?
-
August 18th, 2009, 05:07 PM
Here is my code:
void func1(char * var1){
...
}
std::string str;
func1( str... /* question here */ );
-
August 18th, 2009, 03:56 PM
yes, this is the question I want to ask actually.
if I change to:
std::string test(){
std::string var1;
var1 = "test";
return var1;
}
-
August 18th, 2009, 03:42 PM
char * test(){
char var1[10];
var1 = "test";
return var1;
}
var1 is a local variable, so I was wondering if I return the pointer to var1. Could memory of var1 being freed when the...
-
August 18th, 2009, 06:04 AM
so is there certain rule I should follow? I mean how do I know when I need static keyword, when I don't need? Can I ignore const keyword too?
also what does this method called? setter? what...
-
August 18th, 2009, 06:00 AM
so even though we don't know where those strings are created, what's the reason not to change them? because some memory location could be read only?
-
August 18th, 2009, 05:57 AM
I don't understand is that is npos returning a number?
What if I have several string here, does each string has its own npos? or npos only reflects the last call?
-
August 17th, 2009, 06:31 PM
The documentation says if not found, npos is returned. How do I use that?
first = tempString.find_first_of(" ");
if(first == std::string::npos){
...
}
Is it something like this?
-
August 17th, 2009, 05:49 PM
I read FAQ note from Gabriel Fleseriu here: http://www.codeguru.com/forum/showthread.php?t=231162
He explained this is a bad programming practice:
char* s = "Hello";
s[1] = 'a'; ...
-
August 17th, 2009, 01:33 PM
Hi:
I am using many libraries in my project. I got this error:
1>------ Rebuild All started: Project: test, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for...
-
August 14th, 2009, 08:21 PM
Hi:
I have seen code like this:
class test{
const static string var1;
-
August 13th, 2009, 01:51 PM
My code:
void func1() throw() {
...
}
void func2() throw(int) {
...
throw(1);
-
August 11th, 2009, 02:22 PM
yes, but this works too:
testFunc( std::string( "cool" ) + "foo" );
The compiler knows to add a string with a pointer. How come?
-
August 11th, 2009, 02:15 PM
Thanks, it works.
But why this one works:
testFunc( "cool" );
This one doesn't:
-
August 11th, 2009, 02:06 PM
Thanks for your help.
But I tried, it doesn't work. It gives me 38 errors for that line.
I also tried:
testFunc( std::string a( "cool" ) + std::endl + std::string b( "foo" ) );
Also doesn't...
-
August 10th, 2009, 04:39 PM
so how do I prevent it from calling the ABC destructor? I will need the ABC to be there for later usage.
-
August 10th, 2009, 03:57 PM
This is part of my code:
void testFunc(std::string){
...
}
testFunc("cool" + std::endl + "foo");
|
Click Here to Expand Forum to Full Width
|