Hello I hope someone can explain this problem. This is the code:
class Memory{
public:
PacketPtr pkt;
MemoryPort* port;
MemCtrlQueueEntry(){};
};
And after I do:
std::list<Memory*>::iterator lastIter = NULL;
And I get the following error:
error: conversion from long int to non-scalar type std::_List_iterator<DRAMMemor...
Hello,
I would like to be able to import png file inside of Visual Studio Resource Editor so as to be able to use the embedded resource in different other projects . Is there a solution for that? I know that it works for bitmaps but i am interested in the pngs because of the "transparency" that is availble even on lower format [16x16] o...
Win32's CreateFile has FILE_FLAG_DELETE_ON_CLOSE, but I'm on Linux.
I want to open a temporary file which will always be deleted upon program termination. I could understand that in the case of a program crash it may not be practical to guarantee this, but in any other case I'd like it to work.
I know about RAII. I know about signals...
Greetings :)
I've been reading up on STL containers in my book on C++, specifically the section on the STL and it's containers. Now I do understand each and every one of them have their own specific properties, and I'm close to memorizing all of them... But what I do not yet grasp is in which scenario each of them is used.
Could a kind...
I am working on a platform with a gcc compiler however boost cannot compile on it.
I am wondering what is the proper way to include the shared_ptr in std:tr1 on gcc? the file i looked in said not to include it directly, from what i can tell no other file includes it either :|
...
I'm mostly happy working in my c# job, but when I browse job listings (particularly startups), it seems that the positions I personally find to be most interesting require lots of experience with a linux stack, c++, and python. I coded in c++ for a few years (it was my first programming language), but that was nearly a decade ago. The jo...
Can a class overload methods that also exist in the publicly inherited interface?
It seems like this is unambiguous and useful, but compilers (VC, Intel, GCC) all complain, at least by my construction.
Below is a toy example. The inherited rebound() function has two clear overloads, yet this will not compile. If you rename the rebound()...
Is there a way to use the new keyword to allocate on the stack (ala alloca) instead of heap (malloc) ?
I know I could hack up my own but I'd rather not
...
Hi,
I've read a file, and stored its contents into a string array.
I need to change some numerical values, interpreted as characters by the compiler.
The file is of the format: ABCDE,EFGHIJ KLMNOPQRS,45.58867,122.59750
I've searched and studied but haven't got onto anything too comprehensive.
If someone can please tell me how to do ...
Here's the thing: I have two applications, written in C++ and running on two machines with different OS (one Linux and one Windows). One of this process is in charge of updating an XML file on a NAS (Network Attached Storage) while the other one reads this file.
Is it possible to synchronize these two processes in order to avoid readin...
Some time ago I wrote a little piece of code to ask about on interviews and see how people understand concepts of cache and memory:
#include "stdafx.h"
#include <stdlib.h>
#include <windows.h>
#include <iostream>
#define TOTAL 0x20000000
using namespace std;
__int64 count(int INNER, int OUTER)
{
int a = 0;
int* arr = (int*) H...
My compiler behaves oddly when I try to pass a fixed-size array to a template function. The code looks as follows:
#include <algorithm>
#include <iostream>
#include <iterator>
template <typename TSize, TSize N>
void f(TSize (& array)[N]) {
std::copy(array, array + N, std::ostream_iterator<TSize>(std::cout, " "));
std::cout << s...
Hello,
Is it a good idea to use GetGuiResources(GetCurrentProcess(),GR_GDIOBJECTS) at the start of winmain, and before the last return to detect GDI leaks or more specifically objects I forgot to release ?Also I'm currently wondering why the first call in my progam returns 4 when there's no window yet.
...
Is there support for lambda expressions from C++ 0x in Visual Studio 2008 SP1? Example below throws me syntax errors. Is there any '-Cpp0x' flag for compiler or something?
#include <algorithm>
#include <iostream>
#include <ostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
for (int i = 0; i < 10; ++i)
...
The MSDN documentation has several open arrow examples but no examples for filled arrows.
I just want to create a bigger arrow than the default LineCapArrowAnchor. I tried several things and can't get it to work. It should be simple, right?
...
I've played with boost::pool a few times in places where it seemed to me I was seriously hammering the heap with a lot of object "churn". Generally I've used boost::object_pool, or boost::pool_alloc as an STL template parameter. However the result is invariably that performance is virtually unchanged, or significantly worsened.
I'm cu...
Hello, I'm working in C++ and I need to know if a scalar value (for instance a double) is "defined" or not. I also need to be able to "undef" it if needed:
class Foo {
public:
double get_bar();
private:
double bar;
void calculate_bar() {
bar = something();
}
};
double Foo::get_bar() {
if ( undefined(bar) )
...
Is there a tool which generates the state space by seeing the code. i.e., if I give a class definition, it should generate the state machine.
EDIT: State machine I mean is just the graphical representation of the classes and state changes.
...
What would be the best way to implement, store, and render spherical worlds, such as the ones in spore or infinity but without the in-between stages of spore, and multiple worlds ala infinity universe. Make no assumptions on how the planet itself is generated or its size/scale.
...
Is that .NET related?
It appears to be a pointer of some sort, what is the difference?
Edit:
I actually know it is the XOR operator, but look at this example from this page.
void objectCollection() {
using namespace System::Collections;
**ArrayList ^as = gcnew ArrayList;**
//... }
What is this?
Thanks.
...