To write a wrapper for some obsolete code that takes array of c strings as its argument.
Type: Posts; User: Antigloss
To write a wrapper for some obsolete code that takes array of c strings as its argument.
Thank you very much every one for your kindly help. Learnt alot from you.
To convert any container holding strings to an array holding c strings.
Greetings.
I wanna write a template function that accepts any container type (such as vector, set, list) but restricts the element type of the container to be string.
I've tried this, but...
I'm reading Inside the C++ Object Model, and I'm somewhat confused as described below:
At the end of "1.2 A Keyword Distinction", the author pointed out that "This idiom is no longer recommended,...
hi guys and gals, here i've got a problem and ask for your kindly help.
#include <cstdlib>
#include <cmath>
#include <iosfwd>
#include <iostream>
#include <iterator>
#include <vector>
well, i see. Thanks alot, everybody
Can you please tell me which section of the Standard guarantees these behaviors and why the 1st behaviour is guaranteed? For what good?
but why the temporary object in the first sample is destroyed when after main is finished where as the temporary object in the second sample is destroyed immediately? Test() creates just the same...
First please look at the code
#include <iostream>
using namespace std;
class Test {
public:
finally, i got how to specialize template methods
class t {
public:
template <typename T>
void tt(T i) { }
};
template <>
but as you can see here, this is a complete specialization, not partial.
Partial specialization is OK for function too.
compiled the following code
class t {
public:
template <typename T>
void tt(T i) { }
template <>
void tt(int i) { }
};
that's because I commented out the errorous code
// copy(vec.begin(), vec.end(), ostream_iterator<test>(cout, " "));
it'll be a compile-time error if you uncomment this line.
I defined a class `test' and also overloaded the << operator for it. It came out that I can apply cout to objects of test to print the contents to the console, but I got stuck when trying to print...
What if I don't fill it with anything? That is, I don't write the following code
12 memset (icmp->icmp_data, 0xa5, datalen); /* fill with pattern */
The following code is from UNP
1 #include "ping.h"
2 void
3 send_v4 (void)
4 {
5 int len;
I've tried ACE but found it not quite meet my need. I think it not better than using the native Unix APIs except that it is portable.
Please kindly suggest me a good portable network programming...
In C++, when the stream is in an error state (e.g. eofbit being set), we cannot perform either read or write operation on that stream. But if it's in C, what happen when the stream is in an error...
As is shown above. What is host environment?
As fflush(stdin); is wrong. Some one suggests using rewind(stdin) to eliminate input buffer and also clear error state of the stream. Is that right?
I used Dev-C++ to compile this code, and it...
I wonder which functions set status indicators. Could you please give me a list of those functions? Thanks.
Yes. That's what I am thinking about.
Suppose I write a class as follows:
template <class T1>
class have_a_try
{
public:
template <class T2>
T2 test( const T2&, const T2& );
Sorry I didn't make my point clear. Let me try to make it clearer.
C basic data type int is commonly 32-bit-long currently. Does any computer/compiler make int 64-bit-long instead of 32-bit-long?