one question about iostream cout in C++
Hi In such code, what it is called, \\n like this? cout<<"Hello\\n \'world\'!"; What's the basic rule about such characters? ...
Hi In such code, what it is called, \\n like this? cout<<"Hello\\n \'world\'!"; What's the basic rule about such characters? ...
I am tired of writing shared_ptr<>, it's lengthening the code lines tremendously. Any reason not to do this? ...
I'm new in both javascript and V8. According to Google's Embedder's Guide, I saw something in the context section talking about built-in utility javascript functions. And I also found some .js files(e.g. math.js) in the downloaded source code, so I tried to write a simple program to call functions in these files, but I failed. Does a c...
The unmanaged function(pure c++): void fooC(float& result); I define the wrapper as (managed wrapper, c++\cli): void foo(float% result) //managed interface, need to pass result back to caller { fooC(???);//how to call unmanaged function? } how to pass reference parameter in the wrapper? ...
Hello everyone :) I'm very new to anything involving Component Object Model, and I'm wondering if this method of managing calls to CoInitalize/CoUninitalize makes sense: COM.hpp: #pragma once namespace WindowsAPI { namespace ComponentObjectModel { class COM { COM(); ~COM(); public: static void Setup(); }; }} COM.cpp: ...
I recently read Alan Cooper's "The Inmates are running the asylum" and found it quite enlightening. Anyone of know decent C++ open source projects based on the principles in the book? I'd love to see how ideas from the book are implemented in practice. ...
I'm developing an app in Visual C++ that uses an SQLite3 DB for storing data. Usually it sits in the tray most of the time. I also would like to enable putting my app in a DropBox folder to share it across several PCs. It worked really well up until DropBox has recently updated itself. And now it says that it "can't sync the file in us...
I'm implementing a interpreter-like project for which I need a strange little scheduling queue. Since I'd like to try and avoid wheel-reinvention I was hoping someone could give me references to a similar structure or existing work. I know I can simply instantiate multiple queues as I go along, I'm just looking for some perspective by ot...
I'm having a weird problem with the following function, which returns a string with all the characters in it after a certain point: string after(int after, string word) { char temp[word.size() - after]; cout << word.size() - after << endl; //output here is as expected for(int a = 0; a < (word.size() - after); a++) { ...
EDITED: using c++ to code. void circularList::deleteNode(int x) { node *current; node *temp; current = this->start; while(current->next != this->start) { if(current->next->value == x) { temp = current->next; current->next = current->next->next; delete current->next...
I have: class Foo { int a; int b; std::string s; char d; }; Now, I want to know the offset of a, b, s, d given a Foo* I.e. suppose I have: Foo *foo = new Foo(); (char*) foo->b == (char*) foo + ?? ; // what expression should I put in ? ...
As I am new to Visual C++, there are so many types for handling string. When I use some type and go ahead with coding but on next step, there are in-build functions that use other types & it always require to convert one type of string to other. I found so many blogs but so confused when see so many answers & try but some are working & s...
I have two questions: How to simulate touch event in linux. How to work with multitouch on Qt in Linux. ...
I will try to answer both, please correct me if I am wrong: Where: If a static method is being called using Classname.method() or using reflection then it doesn’t matter even if you change the return type of the calling method, the same method will still be called. So JVM probably checks this in one of the native methods of jvm.cpp ...
Hi all ! What should be the buffer offset value for U & V in YUV444 format type? Like for an example if i am using YV12 format the value is as follows: ppData.inputIDMAChannel.UBufOffset = iInputHeight * iInputWidth + (iInputHeight * iInputWidth)/4; ppData.inputIDMAChannel.VBufOffset = iInputHeight * iInputWidth; iInput...
void CApplication::SendData( const char pBuffer[] ) { if( pBuffer == NULL ) { Log()->Write( ELogMessageType_ERROR, "Cannot send NULL message."); return; } // calculate the size of that data unsigned long messageSize = strlen( pBuffer ); // fix our byte ordering messageSize = htonl( messageSize...
Is anybody knows the free library for uploading over proxy with Http authentication? Maybe some url on samples how it could be. ...
I am on MacOSX. I am writing a multi threaded program. One thread does logging. The non-logging threads may crash at any time. What conventions should I adopt in the logger / what guarantees can I have? I would prefer a solution where even if I crash during part of a write, previous writes still go to disk, and when reading back the lo...
I have pointer str: char* str = new char[10]; I use the memory block str points to to store data. How can I allocate more bytes for the buffer pointed to by str and not lose old data stored in the buffer? ...
Hello, I want to print on the screen the information about Top level windows under Linux. I use the xlib functions. I successfully recurse from the root window to print all the informations about all the element on display. But I need only the Top-Level window. I don't find any good way to filter. From wikipedia : The top-level w...