C++ on Stack Overflow and Game Dev

0 answers

Can Netbeans copy only modified files?

I'm using my VM server (FreeBSD) hosted on Windows 8 and using SFTP option to compile. So when Netbeans is starting building my c++ project remotely (no matter if I'd make it clean or not) its always ...

0 answers

Opengl resource access violation in dll

I'm trying to learn opengl by writting a 2d engine provides layer management. This is how it works now: I have a IEngineLite interface provides some basic function with layers, a ILayer interface. ...

1 answer

c++ array of objects, failed initialization

Need to do a project for school using arrays of class objects. We can't use vectors, so any answers suggesting them will not help. Ive been trying to create such and array, then put a name in each ...

1 answer

Geting a segfault on in a data stream processing program

I am writing a program that processes batches of updates to a graph in the for of new nodes and edges. I recently incorporated a sliding window scheme that checks to see if the edges already in the ...

0 answers

Cuda image pixel invertion function doesn't work

I wrote a couple of functions on both the CPU and GPU to learn how CUDA operates. The objective was to use opencv and invert the pixel values (255 -originalPixel(x,y)) of an image. The function on the ...

2 answers

Deducing the selected overloaded function type for given argument types

Is it possible to determine the function type of the candidate that overload resolution would select given an overload set and an argument list? For example, given: char* f(int); int f(char*); I ...

1 answer

How to run valgrind with basic c example?

Installation: bzip2 -d valgrind-3.10.1.tar.bz2 tar -xf valgrind-3.10.1.tar then: ./configure make make install or simplier sudo apt-get install valgrind How to run valgrind on that simple ...

2 answers

Delete[] array breaks my c++ program

I have had this issue for a while now. Every time my grow function calls the delete line, the program breaks. It doesn't give me an error besides it has reached a break point. I have not found a ...

0 answers

C++ bad memory alloc exception

Here is a gist of what I am trying to do. I store files in SQL table. The table is large with 400 records but each record stores the file archive and their size is approximately 100MB each. Recently, ...

0 answers

WAL with linux and win

I have a sqlite3 3.8.8.2/3 database me.db. I access it from: C++/odb (linux64/win64) in read only mode python3 (linux64 server) in readonly mode from process 1 and read/write mode from process 2, ...

1 answer

C++ | Queue: Dequeue function crashes program

I am attempting to make a queue in c++ using a double linked list. I Have not fully tested everything since i am stuck at the step where you dequeue. I attempted to create a temp node, and move around ...

1 answers | 31 mins ago by Tanner Summers on Stack Overflow stackoverflow.com
1 answer

Reverse characters of each words in vector string

vector <string> theWords; theWords.reserve(100); istream_iterator <string> stringReader(cin); istream_iterator <string> stringReaderEOF; while(stringReader != stringReaderEOF) ...

0 answers

Need help in choosing platform for creating simple GUI database manage app on C++

I'm a student and my course project is creating a Windows app with GUI interface that manage a simple database with a few fields. We're already working on C++, MySQL on Phpmyadmin in Web(not MVS), ...

2 answers

EVP keygen fuctions produce identical keys every time

I am trying to generate a unique RSA keypair using the EVP functions and then save it PEM encoded. My tests however have produced a situation where the same key pair appears to be generated each time. ...

2 answers

How do I create two main windows with GLUT?

I am doing an excercise where I draw three boxes across three windows using GLUT. They draw individually, but in the same project, the three windows display correctly, but immediately close the ...

2 answers | 44 mins ago by Timelord64 on Stack Overflow stackoverflow.com
0 answers

Passing an index macro to compiled modules

I compile my project using a makefile with an expression in the style of g++ a.cpp b.cpp c.cpp Is there any easy way to define a macro that will increment every file? (e.g. a 0, b 1, c 2) Needless to ...

2 answers

Examples on template metaprogramming over constexpr?

Is there any examples out there where template metaprogramming would be better to use than the new constexpr? From what I've understood, both constexpr and template metaprogramming have similar ...

56 answers

Split a string in C++?

What's the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I'm not interested in C string functions or that kind of ...

56 answers | 49 mins ago by Ashwin on Stack Overflow stackoverflow.com
5 answers

Number of unique elements in a vector

If I have a vector of floats as {1.2,1.2,1.2,1.3,1.4} and I have to find out the number of unique elements, how can I do it? I am new to C++ and I don't really know how to use iterators. Thanks! ...

5 answers | 57 mins ago by Elliot on Stack Overflow stackoverflow.com
1 answer

g++4.9 libstdc++ std::string support for C++11 broken

Does anyone know if libstdc++ in g++ <= 4.9 is fully C++11-compliant (or claimed to be)? For example, the code below does not compile (compiles on clang): #include <iostream> #include ...

1 answers | 1 hour ago by vsoftco on Stack Overflow stackoverflow.com
4 answers

How to make this “template / constexpr” construct more elegant / less verbose?

I have this pseudo bitfield implementation: class Field { public: constexpr Field(int i, int s) : index(i), size(s) {} constexpr Field(const Field & prev, int s) : index(prev.index + ...

1 answer

C++ Strange behavior in my own stack class

Here is a program with my Stack class and some another functions. ReadTheFile() - reads numbers, which are stored in num_file.txt, and returns a vector with those numbers. IntervalCheck() - ...

1 answers | 1 hour ago by E_Tony on Stack Overflow stackoverflow.com
3 answers

Instant sort when put new value in array C++

I have a dynamically allocated array containing structs with a key pair value. I need to write an update(key,value) function that puts new struct into array or if struct with same key is already in ...

3 answers | 1 hour ago by Yochert on Stack Overflow stackoverflow.com
1 answer

hardcoded address in disassembly

I'm writing optimized Windows based shellcode in C++ and I have problem avoiding hardcoded addresses in C++ while passing it to function. e.g: My_CreateThread(NULL, NULL, ...

2 answers

How to get a Windows symbol server set up

I have a spare server on the network that I'd like to have host all of our build symbols. I already know how to set up a symbol cache on my local development system and pointing my debugger (e.g. ...

2 answers

Set string to file contents c++

I was wanting to know if there was a simple way to set a std::string equal to the contents of a file in c++. So far, I was thinking something like this(although I haven't tested it, so I don't know if ...

1 answer

Lua return custom data from C function

Despite searching hard, i couldn't find a valid Lua C API example for calling a Lua function returning custom data from C function. For example, I have register function "GetMyVector" and then I'm ...

1 answers | 1 hour ago by user2887378 on Stack Overflow stackoverflow.com
2 answers

Failed With Overloading the Insertion Operator

I am not sure what I am doing wrong here but I used Google and found almost the identical code to mine but they did not claim an error. Our assignment is to overload the insertion operator. The ...

1 answer

C++ Releasing memory after struct initialise?

I'm creating my_data this way. Should I manually free the memory at the end of program? If yes how do do that? free() gives me conversion err, and delete() wants pointer. struct data{ int a; ...

1 answers | 1 hour ago by Veiun on Stack Overflow stackoverflow.com
0 answers

stm32f4 read/write to flash

i have a stm32f4 discovery. i try to put and read variable to flash float dataflash1 = 12.12; float gain; uint32_t Address = 0x08000000; HAL_FLASH_Unlock(); HAL_FLASH_Program(TYPEPROGRAM_WORD, ...

15 30 50 per page
1 2 3