General C++ Programming - January 2018 (Page 8)

How to convert jpg to avi file?
 
Hi, I developed code below to convert jpeg to avi, but it does not work. Could you help me? AVIFileInit(); hr = AVIFileOpen(&pFile, file_name, OF_WRITE ...
[2 replies] Last: I think you just decompose the jpg back to logically a "2-d" image of ... (by jonnin)
Error in recursive function (1,2)
 
Hi everyone, I was tasked with writing a program, that for an input n returns a wall with the biggest height possible. The rows have to consist of 'bricks' from...
[27 replies] Last: #include <iostream> #include <vector> #include <algorithm> #include <... (by lastchance)
False sharing issue for multiple serial codes in multicore pocessror
 
I am running serial jobs in a compute nodes with 24 core (48 thread). When I run only one job in the node, it gives me the maximum performance. But once I i...
[3 replies] Last: Linear time decrease for running more copies tells me that it may be t... (by jonnin)
Long multiplication is wrong.
 
Hello, I'm trying to calculate big numbers but it's not working. I turned every variable into long and switched my project to x64. Here is my code. Thanks! in...
[8 replies] Last: Thank you very much! (by Putarda)
Using Bus Card Object in the User Object
 
Hey guys, I want to use CARD object for the USER object. This is a simple Public Transportation Card project. The card has "enum cardType" and "int Balance". Ev...
[3 replies] Last: You're welcome! I think I've already answered your question, as far a... (by MikeyBoy)
by urko18
Problem saving an array
 
Hello everybody, I am doing a program in arduino and I have a question / problem: My program controls a robotic arm with 4 dynamixel motors using an Arbot...
[12 replies] Last: I'm sorry jonnin, but I've been ocupated and also have coincided Chris... (by urko18)
by Handge
ASCII-based Text RPG
 
I have finished Act I in my new ASCII-based Text RPG. To attack there is a bar in which when you press space it tells you if you had Hit, Crit, or Missed, Green...
[6 replies] Last: Thanks, I am going to add more items etc. The sentences you see appear... (by Handge)
The default meaning of precision?
 
I'm trying to understand what precision actually means by default (without using std::fixed and similar). #include <iostream> #include <iomanip> int main() {...
[5 replies] Last: Ah, OK, thank you, so it becomes printf("%.5e\n", 0.00001) which pri... (by Peter87)
Username and password
 
This code is wrong in somewhere.Can you help me find out, how to display of any account that i just enter, i just complete in 2 of case , help me in case 2, pls...
[2 replies] Last: It would be easier if you create a struct and use a vector. struct A... (by Thomas1965)
Behavior Of Destructor
 
Hi, I am trying to work with shared_ptr ,and trying to execute a simple binary tree. However the behavior of the destructor is confusing me . This is my Code: ...
[3 replies] Last: Thanks Cubbi,I was wondering over mbozzi's answer. Now I can track my ... (by NiharRNanda)
Constructing Class in Function to be used Elswhere
 
Hi. I have three classes. Image Text buttonObj They all have unique constructors and functions. buttonObj has an Image member and a text member. My prob...
[3 replies] Last: Please provide: a.) the error message(s), verbatim; b.) the definition... (by mbozzi)
Programming Assignment
 
I'm very new to programming, and I would really like help, just enough to know where to start this problem, everyone in my class is having troubles with it too ...
[1 reply] : Hi, do you know how to read from a file? You should read http://www.cp... (by Ganado)
Difference between a standard facet and it's _byname version
 
I have tried deriving a custom numpunct<> facet from both numpunct<> as well as from numpunct_byname<>. Both give the same results and both approaches work. ...
[no replies]
Code works with Template Function but doesn't with Template Struct
 
There are 2 snippets of code: the 1st works, the 2nd doesn't 1st uses functions template <typename T> constexpr bool contains() { return false; } template...
[2 replies] Last: Are you sure the first Error is the one reported? I would expect 'con... (by gedamial)
Programming Assignment
 
I have to create a program that asks a person to enter numbers (1-99) and convert it into words. I've been working on this for days and I still don't see what I...
[3 replies] Last: Another way to handle this might be to input the number as a string, t... (by mainecat)
How to support an MP3 controller in my software
 
I have DJ software and I would like to be able to control it via an mp3 controller just like the rest. I can imagine it's just exporting json data over a port, ...
[no replies]
Why (void) at the start of an expression?
 
Hi, I have this code: static void _(Types... t) { using swallow = int ; (void) swallow { (process(t),0)... }; } What do...
[1 reply] : Casting to void is used to signal that the author knows there is an "u... (by cire)
by a10e29
srand() frequency
 
How often should someone call srand()? Is it worth it to call it more than once? For example before each call to rand() or after x time. Thanks for your time...
[5 replies] Last: as a side note, you can use these things as a hash function, reseed of... (by jonnin)
Judge utf8 string is chinese
 
hello, i got a utf8 string, how could i use C++ regex to judge the string contains only chinese characters, engish letters(a-zA-Z) and digits(0-9), and calculat...
[2 replies] Last: If you're looking for the number of code points in a UTF-8 string, it'... (by Cubbi)
A Question About Variadic Templates
 
hello! I was recently introduced to variadic templates in C++ by a friend and i feel like i have an use case that would really benefit from them but i can't rea...
[1 reply] : Something like this: template < typename T, std::size_t... > struct ... (by JLBorges)
January 2018 Pages: 1... 678910
  Archived months: [dec2017] [feb2018]

This is an archived page. To post a new message, go to the current page.