General C++ Programming - March 2020

How do i add SFML 2.5.1 to my path?
 
This message shows up on Atom: fatal error: SFML/Graphics.hpp: No such file or directory #include <SFML/Graphics.hpp> ^~~~~~~ compilation terminated.
[no replies]
Assignment
 
Using C++ programming, design and develop medical and engineering applications. The project should use the files to store data. The program must consist of...
[2 replies] Last: #include <iostream> #include <cctype> #include <limits> int main() {... (by George P)
how to convert void* to int
 
I am using a library which has callback function with void* as a parameter. I need to get int from this void*, below code works fine in c but not in c++ In c...
[5 replies] Last: Thanks everyone for the response, Doing below cast works static_cast<... (by Scarletpimp)
by Utku
SFML rotation of sprite with small steps
 
Hello everyone. I want to rotate a sprite with small step sizes. I do not want to write directly as: sprite.setRotation(90); I want to do it wit...
[5 replies] Last: It should be seen as continuous change in rotation. Every game frame... (by George P)
Cannot create a std::vector of const std::string!
 
Hi, I cannot create the following vector: std::vector<const std::string> constvec; I get these errors: error C2440: 'initializing': cannot ...
[1 reply] : Can't do it. https://stackoverflow.com/questions/6954906/does-c11-all... (by Ganado)
by joe809
Lexeme Tokens
 
Hello, I'm having trouble returning the correct number of Tokens in a file. For example, the input of the file is as follows: "a regular string" "skipping\nto...
[5 replies] Last: When you read the escape character ("\"), you want to read the next c... (by doug4)
unique words from file!!
 
its been 3 days i just cant identify whats wrong with the program the program should compare words by words instead it only comparing a character to charcter it...
[3 replies] Last: At least one mistake is on line 22: Replace sizeof(temp) with temp.... (by coder777)
by OYS
How to read a text file with data separated by commas into different variables respectively
 
9780099584353,Haruki Murakami,Norwegian Wood,Vintage Publishing,2003,1,37.90,1,2 The data represents isbn code, author, title, publisher, year published, qua...
[5 replies] Last: > but what if i want to insert the text file into an array? how do i d... (by salem c)
Find the "Initial Patient" of a disease using code.
 
Can anyone help with this problem? It's a last in a set of challenge problems I've finished the other problems for, and I really don't know where to even begin ...
[3 replies] Last: I've only thought of throwing out the cases where two healthy cows int... (by BBrandon)
by Catchy
trying to make a player go around a map and give you certain phrases when you land on specific spots
 
The problem that im having is that when the player goes over any of the map tiles it doesnt register properly. #include <iostream> #include <iomanip> #incl...
[1 reply] : > if (gameBoard == gameBoard || gameBoard ) This isn't how you co... (by salem c)
Creating a Mode function using array ponters
 
I am trying to create a mode to find the mode in an array of pointers. In my code works except for my find mode function. I set mode to return -1 if it is unab...
[2 replies] Last: I was able to get my code to work by modifying it so it compared the v... (by Wsaint1990)
by Zanza
Error in function?
 
.
[4 replies] Last: You want help don't edit your posts and delete the contents. Doing so... (by George P)
How to efficiently pick points from a given array so the distance between the two closest points are maximized.
 
Hello. So I've been trying to solve this problem from my coding camp that has stumped me for hours. I've got a solution, but with the higher test scenarios, it ...
[8 replies] Last: It's not for me to solve the puzzle for you. You're the one who presum... (by dutch)
how create a 3D Game without libraries?
 
ok... know that uses very math... but is there any tutorial for i create my 1st shooter game? - how draw the images(position, size and angle); - how create th...
[15 replies] Last: that entire image is 2 images for the cube... in these case i use the ... (by Cambalinho)
Should we initialise queue and maps of a class in constructor
 
I have a class which has queue and map like below where astruct is a structure and aclass is a class. Should i initialise these in a constructor? Is so how do i...
[3 replies] Last: Thanks, that answers my question. (by Scarletpimp)
by kainev
Entity Component System - Map Performance
 
I'm currently implementing a small Entity Component System as a learning project, it's been a good way to learn about generics, memory, and performance. All...
[5 replies] Last: Note that I said an intrusive linked list, since that doesn't requir... (by helios)
by DeeMoo
Consol crash using Graphics.h
 
Hi! So basically everything goes okey, no crashes. It display what is asked. But when I create a loop which can only be broken by the user, it crashes after 6 ...
[8 replies] Last: I solved the problem. I changed initgraph to initwindow, deleted getch... (by DeeMoo)
by jonnin
Statistical Analysis For student's coursework marks listed.
 
I have a fairly involved question about how to start ^^^ you forgot to type in your question. You just gave us a copy of the homework.
[12 replies] Last: Tom Knight and the Lisp Machine I was going to quote this here yeste... (by mbozzi)
by R0bert
How to print all the diagonal elements of a 2d vector
 
For example I have a 2d vector matrix = [ [1,2,3,4], [5,1,2,3], [9,5,1,2] ] and I want to print the elements in diagonal order from the bottom ...
[8 replies] Last: ... (by Ganado)
A tricky twist on the classic find#inversions in array problem
 
The problem I have is an an admittedly difficult spin on the classic count number of inversions in an array problem. Essentially, you are given an array with 1<...
[1 reply] : {1, 2, 3, 4, 5} 0 1 2 3 4 Isn't that a linear... (by keskiverto)
March 2020 Pages: 123... 7
  Archived months: [feb2020] [apr2020]

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