Search:
Type: Posts; User: po0ky
Search:
Search took 0.01 seconds.
-
August 9th, 2013, 01:01 AM
Thank you again for both answers.
Ofcourse its always better to use the library functions, but still I would like to know how these functions work.
Even in this small code there are always...
-
August 8th, 2013, 02:19 AM
Thank you for all of your answers. It was very educating. Best way to go would probably be to use strlen.
Strlen would probably look like something like this?
int len(const char ar[]) {...
-
August 6th, 2013, 06:30 PM
#include <iostream>
int len(const char ar[]) {
return sizeof(ar)/sizeof(*ar);
};
int main(){
printf("%d",len("124567"));
std::getchar();
}
-
Thank you VictorN.
@McKenzie
I've given it some thought but I believe you're wrong. The fact is... you don't know all the details about how I'm implementing the class. The sD class isn’t...
-
And i got to check if the pointer is pointing to something before deleting it?
-
I bet one of the things wrong with my code is that I dont initialize my variables?
-
Thank you both for the fast reply...
Thank you for your answer Philip Nicoletti, it works.
@Paul McKenzie
I know I need to check for self-assignment....
The reason for the new/delete...
-
As the title shows, I find it hard to come up for a good description of the problem I encountered.
Please can some of you guru's help me?
#include <vector>
class sD
-
March 31st, 2010, 02:04 PM
I think we have a winner. This could probably only be faster if the size of the resulting vector would be hard coded.
I have read somewhere that lists are faster in sequential processing, but even...
-
March 30th, 2010, 06:58 PM
How did you know that?
It's as if you are looking over my shoulder.
o_0... I gues i'm still a real noob...
Well I did the timing again, and my god you are right. Cilu's method is...
-
March 30th, 2010, 05:13 PM
I'm sorry but... thats just awfull, slow and sluggish.
-
March 29th, 2010, 05:28 PM
There I go blaming the compiler again. Thanks Paul McKenzie I think I understand the problem better now.
I think this would be a good solution, if not the only solution.
I'll try it right...
-
March 28th, 2010, 04:47 PM
No, according to the debugger the vector holds all the items the cout is giving me.
Pynolathgeen seems to get the expected results.
Thats why I think its a bug in my compiler.
@Pynolathgeen...
-
March 28th, 2010, 01:19 PM
Nope, keep having this problem. Maybe it's my intel atom, or it's because I'm using visual studio 2008.
However...
for(;i>0;--i){
std::string str = strvec[i-1];
strvec.push_back(str);
}
...
-
March 28th, 2010, 09:46 AM
Thats even stranger. The origenal program is longer than this example.
In the original A,B,C and D are "real" strings.
A for example is X10, B is pauze, C is Y20, D is pauze and E is X-20.
In my...
-
March 28th, 2010, 09:31 AM
Hello,
I've got a strange problem:
#include <vector>
#include <iostream>
#include <string>
int main(){
std::vector<std::string> strvec;
|
Click Here to Expand Forum to Full Width
|