I am working on const-correctness of my code and just wondered why this code compiles:
class X
{
int x;
int& y;
public:
X(int& _y):y(_y)
{
}
void f(int& newY) const
{
//x = 3; would not work, that's fine
y = newY; //does compile. Why?
}
};
int main(int argc, char **argv)
{
int i1=0, i2=0...
Hi!
I've got a code (which works fine) for piloting word with C++ Builder.
It's useful for reaching different bookmarks in the document.
Variant vNom, vWDocuments, vWDocument, vMSWord, vSignets, vSignet;
vNom = WideString("blabla.doc");
try
{
vMSWord = Variant::GetActiveObject("Word.Application");
}
catch(.....
Which is better to use openssl or windows capi for ecnryption issues what is the pro and con list for both.
and if it possible to write my encryptor program on openssl and decrypt it with windows capi with no problem or there are some problem with this.
...
Hi all!
I have to show RGB888 content using the ShowRGBContent function.
The below function is a ShowRGBContent function for yv12->rgb565 & UYVY->RGB565
static void ShowRGBContent(UINT8 * pImageBuf, INT32 width, INT32 height)
{
LogEntry(L"%d : In %s Function \r\n",++abhineet,__WFUNCTION__);
UINT16 * temp;
BYTE rValue, gValue, bValue;...
char b;
operator<<(cout,(operator>>(cin,b)));
this is not compiling in vc++ because all 8 overloads cant convert this type.
can any one explain this.....
is their a problem with return type...........
...
I always thought the following types are "fundamental types", so I thought my answer to this question would be correct, but surprisingly it got downvoted...
Searching the web, I found this. So, IBM says as well those types are fundamental types..
Well how do you interpret the Standard? Are the following types (and similar types), "fun...
Hi All
I am working with the new version of boost 1.42 and I want to use regex with named sub groups. Below an example.
std::string line("match this here FIELD=VALUE in the middle");
boost::regex rgx("FIELD=(?<VAL>\\w+)", boost::regex::perl );
boost::smatch thisMatch;
boost::regex_search( line, thisMatch, rgx );
Do you know how to g...
After reading about the problem of passing empty std::string objects between DLLs and EXEs, I am concerned about the configure options used to build my gcc / libstdc++. More specific I want to know if --enable-fully-dynamic-string was used during ./configure.
I'm using MinGW 4.4.0 on Windows XP.
Does anybody know the configuration use...
RapidXML is a fast, lightweight C++ XML DOM Parser, but it has some quirks.
The worst of these to my mind is this:
3.2 Ownership Of Strings.
Nodes and attributes produced by RapidXml do not
own their name and value strings. They
merely hold the pointers to them. This
means you have to be careful when
setting these value...
Hi all,
I have a request that works fine when I use the WinInet API. I now want to make that request with the WinHTTP API as I already use it in my project and as it is simply better. My request is used for calling JSON. I already authenticated before calling this. When authenticating I get a SessionID that I send via cookie.
So here is ...
I know how to make the list of the Fibonacci numbers, but i don't know how can i test if a given number belongs to the fibonacci list - one way that comes in mind is generate the list of fib. numbers up to that number and see if it belongs to the array, but there's got to be another, simpler and faster method.
Any ideas ?
...
Hello everyone,
It is mentioned in C++ FAQ site -- "larger derived class objects get sliced when passed by value as a base class object", what does slicing mean? Any sample to demonstrate?
http://www.parashift.com/c++-faq-lite/value-vs-ref-semantics.html#faq-31.8
I am using VSTS 2008 + native C++ as my development environment.
thanks...
Is there any way to determine s/n of usb-drive in linux using C++ ?
If not C++ is there any other way different from hwinfo -disk and hdparm -i ?
...
I'm doing some prototyping with OpenCV for a hobby project involving processing of real time camera data. I wonder if it is worth the effort to reimplement this in C or C++ when I have it all figured out or if no significant performance boost can be expected. The program basically chains OpenCV functions, so the main part of the work sho...
Hi, there's an open-source application I need to use. It allows you to use a custom dll. Unfortunately, I can't code c++; i don't like it; it don't want to learn it.
I do know PHP very well however, thus you can see that I'll rather do my logic within a PHP application. Thus I'm thinking about posting the data from c++/dll to a url on m...
I'm trying to sort a list (part of a class) in descending containg items of a struct but it doesn't compile(error: no match for 'operator-' in '__last - __first'):
sort(Result.poly.begin(), Result.poly.end(), SortDescending());
And here's SortDescending:
struct SortDescending
{
bool operator()(const term& t1, const term& t2)
...
I have run though a code formatting tool to my c++ files. It is supposed to make only formatting changes. Now when I built my code, I see that size of object file for some source files have changed. Since my files are very big and tool has changed almost every line, I dont know whether it has done something disastrous. Now i am worried ...
Hi,
I have made a sample application which constructs a filter graph to capture audio from the microphone and stream it to a file. Is there any filter which allows me to stream to a memory buffer instead?
I'm following the approach outlined in an article on msdn and are currently using the CLSID_FileWriter object to write the audio to...
Consider the following function:
void f(const char* str);
Suppose I want to generate a string using stringstream and pass it to this function. If I want to do it in one statement, I might try:
f((std::ostringstream() << "Value: " << 5).str().c_str()); // error
This gives an error: 'str()' is not a member of 'basic_ostream'. OK, s...
I'm reading the moust cursor pixmap data from the StdFBShmem_t structure, as defined in the IOFrameBufferShared API.
Everything works fine, 90% of the time. However, I have noticed that some applications on the Mac set a cursor in a different format. According to the documentation for the data structures, the cursor pixmap format should...