Re: basic question about "clearing" a string....


Well, I think I can understand Avalon's rant. If someone were to answer with a smart-alec response that Bazarov did, I think I would be pi$$ed off too. A straightforward answer like what Herring said may have averted these quarrels... ...
Posted On: Monday 26th of November 2012 12:47:13 AM Total Views:  423
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




About Precompiled headers

I just toggled from Dev C++ to VC++ 6.0 to see what's it with no experience. But even in a simple "hello world" app, i got error: "fatal error C1010 - unexpected end of file while looking for precompiled ...
VIEWS ON THIS POST

115

Posted on:

Monday 26th November 2012
View Replies!

srand in c or c++ doesn't really Generate Random Numbers ?

Hi I am using the srand function generate random numbers.Here is the problem. for example: #include #include int main() { int i = 0,j = 0; srand((int)time(0)); for(i=0; i<10; i++) { j=1+(int)(10.0*rand()/(RAND_MAX+1.0)); std::cout << j << '\t'; } ...
VIEWS ON THIS POST

136

Posted on:

Monday 26th November 2012
View Replies!

Template to insert into a map? Is this really necessary?

I'm working on a program, and at one time I find it necessary to load classes into a map. Now, these classes don't have default constructors, so I can't retrieve them using MyMap[MyKey]. So I wound up with a real ...
VIEWS ON THIS POST

142

Posted on:

Monday 26th November 2012
View Replies!

Doubt regarding Virtual Inheritance

##include using namespace std; class A { }; class B:virtual public A { }; class C:virtual public A { }; class D ublic B, public C { }; int main() { cout << "Sizeof(A) " << sizeof(A) << endl; ...
VIEWS ON THIS POST

168

Posted on:

Monday 26th November 2012
View Replies!

The boost.variant library and boost::make_recursive_variant

We have this code: typedef boost::make_recursive_variant< int , std::vector< boost::recursive_variant_ > >::type int_tree_t; Use of the resultant variant type is as expected: std::vector< int_tree_t > subresult; subresult.push_back(3); subresult.push_back(5); std::vector< int_tree_t > result; result.push_back(1); result.push_back(subresult); result.push_back(7); int_tree_t var(result); According to documentation ...
VIEWS ON THIS POST

257

Posted on:

Monday 26th November 2012
View Replies!

Predefined macro names for machine dependent compilation

Dear all, I was looking at a simple code on an exercise question. In the code, there is a conditional inclusion dependent on __GNUC__ #include #include #ifndef __GNUC__ #include #endif How can I get system specific macro ...
VIEWS ON THIS POST

137

Posted on:

Monday 26th November 2012
View Replies!

Returning more than one value from a function

is pair<> fine for returning two values What about more than two values PS: Values may be of different types. Opinions Thank you Mohit...
VIEWS ON THIS POST

142

Posted on:

Monday 26th November 2012
View Replies!

How to read/write continuous hex dump using STL

all, The program below has a bug... The program is supposed to convert a string to a continuous hex dump and back to a string. The output should be as follows: abcd 61626364 abcd But the output I see ...
VIEWS ON THIS POST

168

Posted on:

Monday 26th November 2012
View Replies!

is a char array created in a function local?

, If a function that returns an array of char like this one: const char* f(){ return "abc"; } then is the char array "abc" local/temporary object I thought it should be temporary and hence the returned pointer should point ...
VIEWS ON THIS POST

143

Posted on:

Monday 26th November 2012
View Replies!

is there anything we can do about Jon Harrop?

The subject line says it all....
VIEWS ON THIS POST

218

Posted on:

Monday 26th November 2012
View Replies!

Simple Tree Syntax Error

I'm creating a real simple tree. No sorting and every node can have infinite children. // TreeNode.h #ifndef TREENODE_H #define TREENODE_H #include #include using namespace std; // forward declare the tree class template< class NODE_TYPE > class Tree; ...
VIEWS ON THIS POST

143

Posted on:

Monday 26th November 2012
View Replies!

about using pthread in cpp

i just want to put *pthred_create* , *pthread_join* into one class, but i do not know how to, anyone help me the code below is mine: ------------------------------ #include #include using namespace std; class CppThread{ public: CppThread():num(0),slp(3){} CppThread(int n,int ...
VIEWS ON THIS POST

145

Posted on:

Monday 26th November 2012
View Replies!

ANNOUNCE: gnocchi 0.33 "complexity ****yser" released

GNOCCHI 0.33 - A COMPLEXITY ****YSER FOR C++ Gnocchi calculates cyclomatic and the NPATH complexity measures. It reads the coverage information produced by GCC and determines the complexity of all functions. If code is compiled with -fprofile-arcs or -ftest-coverage (depending ...
VIEWS ON THIS POST

133

Posted on:

Monday 26th November 2012
View Replies!

How US tech firms place job ads no-one will apply for -- so they can hire cheap foreign workers.

Read all about it, here: http://Muvy.org...
VIEWS ON THIS POST

315

Posted on:

Monday 26th November 2012
View Replies!

reverse_iterator and const_reverse_iterator

, I think the two reverse_iterators are the same, except that the const_ version doesn't allow me to change the value pointed to by the iterators. However, I have a program that works for reverse_iterator but not const_reverse_iterator: for(vector::const_reverse_iterator i ...
VIEWS ON THIS POST

186

Posted on:

Monday 26th November 2012
View Replies!

Declare and initialize a vector on one line?

Is there a way to declare and initialize an stl vector on one line Right now the best I can come up with is //... vector vec; vec.push_back(1); vec.push_back(2); vec.push_back(3); //... -Thx...
VIEWS ON THIS POST

175

Posted on:

Monday 26th November 2012
View Replies!

difference...

HI...This may sound offtrack to this groups..but his is related to this group only.. Can anyone tell me the difference between C and C++... besides object oriented and all that.. In indian companies this question is asked several times..but I ...
VIEWS ON THIS POST

181

Posted on:

Monday 26th November 2012
View Replies!

difference...

HI...This may sound offtrack to this groups..but his is related to this group only.. Can anyone tell me the difference between C and C++... besides object oriented and all that.. In indian companies this question is asked several times..but I ...
VIEWS ON THIS POST

168

Posted on:

Monday 26th November 2012
View Replies!

print IP number from received UDP packet

hi there, I have a working UDP server in c++, how to I print the IP of the received packet\t...
VIEWS ON THIS POST

164

Posted on:

Monday 26th November 2012
View Replies!

Object oriented callbacks and differences in member vs non-member function pointers

I have great respect for the contributors of this newsgroup and have a question that I can't seem to find an answer for, I need to understand if it there is anything in the C++ standard that prevents or ...
VIEWS ON THIS POST

369

Posted on:

Monday 26th November 2012
View Replies!