General C++ Programming - July 2018 (Page 4)

by HarGar
Can't get my menu based application to accept choice
 
I can't get my menu driven app to accept my choice, so I can't even debug the rest of the program because it doesn't run, can someone find where I went wrong? ...
[1 reply] : char is an int, but 1 != '1' your while loop to validate and switch bo... (by jonnin)
A timing problem
 
I users! I'm a programmer, I'm tryng to create a game which works in windows. The libraries that I'm using are: #include <iostream> #include <stdio.h> #in...
[3 replies] Last: Most games run on a simple loop. It might look something like this. ... (by gaxio)
Universal iterator both for vectors and arrays
 
Daer experts, how can I make this code to work both for vectors and arrays? Many thanks and kind regards. - Mauro. /* c++ -o testAuto testAuto.cpp -s...
[1 reply] : Just let the compiler deduce the template argument type and it will wo... (by Peter87)
problem with Jannson.h
 
Hey guys I am doing a project,the project is to make a malware scannner or in other words a program that gets the md5 of a file and matches it with known malwar...
[11 replies] Last: ok figured out I just had to make the makefile (makes sense no pun int... (by adam2016)
Improve hash table algorithm
 
Hi. The exercise is to find all the pairs in a vector that have a difference of k = 2 In the vector below, the pairs are: (1,3) (7,5) (7,9) (5,3) I'm using ...
[10 replies] Last: Thanks to everyone! (by gedamial)
using a template for my Double linked node list(logic problem)
 
[ template <typename T> class LinkedList { public: LinkedList(); LinkedList(const LinkedList& rhs); LinkedList& operator=(const LinkedList& rhs); ...
[6 replies] Last: Thank you all for helping me :D (by JacobusTheOne)
LNK2019: unresolved external symbol errors after migrating down to VS2013
 
I have had to migrate down to VS2013 for my project. Originaly when I was working in VS2017 I was able to add a dll that I created (also in VS2017) without any ...
[3 replies] Last: @Ganado I don't believe so @helios The run time libraries are all set ... (by RslWlsn3)
by Matriz
Hot Plate Simulation
 
I honestly don't know what to do to make this output the information I want it to #include <iostream> #include <iomanip> #include <string> #include <fstr...
[2 replies] Last: [this one was posted 10 min after his identical post in the Beginner a... (by icy1)
by cmisip
Can anyone suggest an algorithm to reduce memory required to store uint16_t data?
 
I am working on a program that sends data via mmap from one process to another. A buffer is used which holds sequential pairs of uint16_t values. Each pair co...
[18 replies] Last: Thanks a lot guys. I will be looking at this and evaluating some othe... (by cmisip)
by K2411
writing a DLL code for WxFormbuilder GUI.
 
Hello all I am not an expert in programming and I need help. #-o it is regarding DLL. I am working on a windows simulation software developed with WxFormB...
[1 reply] : It is always good to take a look at boost: https://www.boost.org/doc/... (by coder777)
Network file access CFile::Open()
 
Hi All, I am trying to access a file on a WD Mycloud Network drive using Visual Studio 2017 and C++ on a Windows 10 setup For instance: const CString FILES...
[no replies]
argc with segmentation fault
 
the issue i am having is when i try and run the program, argv is giving me a segmentation fault when i only put in one command line argument. its temperature co...
[3 replies] Last: If you pass one command line argument,then argc will be 2, and the arg... (by Peter87)
No dangling reference Warning?
 
std::vector<std::function<bool(int)>> vec; void f() { int anotherVal = -5; vec.emplace_back( [&](int val) { return val > anotherVal; } // dangling ...
[12 replies] Last: no, everything out there now is a smackdown on the practice. I distin... (by gaxio)
How to send POST request for request payload data?
 
C++ and libcurl are being used. How do I post "request payload" data? FYI I did ask this on stack overflow but I really need a response ASAP so I apologize ...
[no replies]
ValidateBirthday
 
Hi, I want make validate to birthday have to month 1-12 and the day depends on the days of the month 1-30 or 1-31 or feb 1-29 thank you
[5 replies] Last: Another option: bool is_leapyear(int year) { return year % 400 == ... (by Thomas1965)
glBindBuffer() acces violation
 
I got access violation error here is the code: and The VBO and VAO are in the class called "Graphics" with these functions: // main loop Graphics g; whil...
[2 replies] Last: Found the solution! initglew() must be called before glmakecurrentcont... (by closed account DEhqDjzh)
by James5
menu driven program
 
You need to write a menu driven program. The program allows a user to enter five numbers and then asks the user to select a choice from a menu. The menu should...
[no replies]
How to resize SDL_Rect ?
 
Hi, current my player looks like this (blue is object collider green is background): the collider is 256x256 http://i.hizliresim.com/nlRNa0.jpg but I want it ...
[2 replies] Last: Your image links are broken. (by gaxio)
Initializer before int
 
#include<iostream.h> int i, j, n, t ; char s , A ; struct patrat { char p1; int p2; }A int main() { cout<<"n=";cin>>n; for(i=1;i<=n;i++) for(j=1;j<=n;j+...
[2 replies] Last: variable on the end of struct is C-ish IMHO. I prefer patrat A; But t... (by jonnin)
Deleting and Instantiating Objects Each Frame
 
Is it ok if we create and delete objects in a loop (by heap allocation) like this? while (game.isRunning()) { GameObject* player = new Player(); delete player...
[6 replies] Last: Yes, and there are a lot of issues involving memory allocation that th... (by gaxio)
July 2018 Pages: 123456... 9
  Archived months: [jun2018] [aug2018]

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