Initializing 2D Array In Class Constructor in C++
I define a 2D array in my header file char map[3][3]; How can I initialize the values in the class constructor like this map = {{'x', 'x', 'o'}, {'o', 'o', 'x'}, {'x', 'o', 'x'}}; ...
I define a 2D array in my header file char map[3][3]; How can I initialize the values in the class constructor like this map = {{'x', 'x', 'o'}, {'o', 'o', 'x'}, {'x', 'o', 'x'}}; ...
I have a (C++) system that has many classes that have variable storage (memory) requirements. In most of these cases, the size of the required storage is known at the creation of the object, and is fixed for the lifetime of the object. I use this, for instance, to create a "String" object that has a count field, followed directly by th...
I am designing a server which is used in UDP communication using MFC. I have the following classes CMyDlialog - Take care of User interface CController - Act as an Mediator between all the classes CProtocolManager - Take care of Encoding/Decoding msgs (This is a static class) CConnectionManager - Take care of UDP connection, Sending, R...
How do I generate a list of lines to draw if I have pixel data for an image, so I don't have to draw every pixel? Any language will do, although I listed what I have a working knowledge for. C is ok as well. There was a limit to how many tags I could choose. Also, you can just point me toward an algorithm. ...
I am having a super hard time compiling and using TagLib 1.6.3 in my Qt project. I've tried everything I can think of. TagLib claims that it is supported through CMake but I'm not having any luck. Furthermore, I'm confused about what kinds of files I even need for my Qt libs! I've built *.a files, *.lib, and *.dll. From what I understan...
These are my files: --------[ c.hpp ]-------- #ifndef _C #define _C #include<iostream> class C { public: template<class CARTYPE> void call(CARTYPE& c); }; #endif --------[ c.cpp ]-------- #include "c.hpp" template<class CARTYPE> void C::call(CARTYPE& c) { //make use of c somewhere here std::cout<<"Car"<<std::endl; } ...
Hi, Is there any way to convert the JSON response to C/C++ object structure and,convert the those object (C/C++) objects back to java or Objective c. ...
hello, i need to execute an for loop till the queue is empty my code queue<string> q; for(int i=0;i<q.size(),i++) { // some operation goes here // some datas are added to queue } ...
I found a few questions similar to mine but none of the answers are satisfactory and they are a few years old. So I am hoping that perhaps some progress has been made on that front since then. What I am interested in is the ability to access the content of an active Firefox window and copy it to the clipboard -- using C or C++ code. In...
Hi, I tried this : #ifndef __TEST__ #define __TEST__ namespace std { template<typename T> class list; } template<typename T> void Pop(std::list<T> * l) { while(!l->empty()) l->pop(); } #endif and used that function in my main. I get errors. Of course, I know that there are more template params for std::list...
I wrote a windows service in C++ that needs to restart every night at midnight, so I call exit(1) on it so that it can be restarted by SCM. The problem is it seems every other night it starts up partially and hangs. In the event log, I get this: Application popup -Application Error: The instruction at "0x0043c145" referenced memory a...
Why is my cin being skipped in the following while? int main() { int option; cin >> option; while(!cin.good()) { cout << "Looping" << endl; cin >> option; } } ...
Is it possible to use the iPhone's hardware accelerated decoding of mp3s and AAC when using the OpenAL library? I suppose there are two possible approaches if this is possible. iPhone specific OpenAL extensions. iPhone APIs to decode audio into raw bytes. I have two specific use cases. Completely decode a short sound bite. Piecewise ...
Hi, I am trying to build an application for Windows XP 64bit which is able to detect drives of a particular model in the system, and if they are not initialized & formatted perform these processes. I would also like to be able to query and set the partition information(including the volume label). I have started putting together code ...
Hello, Respectfully!! I need complete list of kernel types such as "CRITICAL_SECTION", "_LARGE_INTEGER" or "_SECURITY_ATTRIBUTES". Basically I am extracting all the data members of class given class name as type from some debugging SDK (right now using DIA SDK or DbgHelp) . Now If a type(say class or struct) contains some kernel level...
What are the things that can be done in C but not in C++, and which of these features do you miss the most while coding in C++? Few things I can think of: We can assign any type of pointer to void pointer without cast in c but not in c++. Declare variable names that are keywords in C++ but not C ;) EDIT : Thanks @sbi for pointing ...
hello , i am running 2 threads and the text i display first is displayed after the execution of thread string thread(string url) { mutex.lock(); //some function goes here mutex.unlock(); } int main() { cout<<"asd"; boost::thread t1(boost::bind(&thread)); boost::thread t2(boost::bind(&thread)); t1.join(...
Why can I not do this? typedef boost::interprocess::unique_ptr<QueueList, QueueListDeletor> UQList; typedef boost::intrusive::list<UQList> List; // Compiler (VS 2003) complains The QueueList is a class that derives from public boost::intrusive::list_base_hook<> to make it part of an intrusive linked list. I want to use unique_ptr ...
Which tool is the best for disassembling C++ executables? I'm looking for something like OllyDbg but for Linux. EDIT: Sorry, forgot to tell that I want to be able to debug, too, not just to see the asm code. EDIT2: By "best" I mean something like - "the best for windows is OllyDbg - can see the asm code and can debug, it's user friendl...
I've seen this code for finding a Minor of a matrix: RegMatrix RegMatrix::Minor(const int row, const int col)const{ //printf("minor(row=%i, col=%i), rows=%i, cols=%i\n", row, col, rows, cols); assert((row >= 0) && (row < numRow) && (col >= 0) && (col < numCol)); RegMatrix result(numRow-1,numCol-1); // copy the content of the matr...