Hello! I'm brand new to learning coding (Codewithmosh.com is what I'm currently learning C++ on.) I had an idea for a project that would help lessen my work load at my job. 90% of my work is writing reports. They are all very similar with small differences based on the contact. We write our...
How can I compile my sfml project using cmake? Using simple g++ command I would do this g++ -o test file1.cpp file2.cpp -lsfml-graphics -lsfml-window -lsfml-system so far I have this in my cmake file:
cmake_minimum_required(VERSION 3.25.2)
project(life)
set (SOURCES file1.cpp file2.cpp)...
I am working with Embedded Lua
So what I want is to be able to report when a host function does something that I think it should not do. I could try to look for an equivalent to the idea of throwing an exception. I also want to have it running in a thread for a game and have another thread...
I'm looking for someone that codes in C++ to create some simple projects with me and share experience. I'm 13 so I don't think it's ok i someone 43 yo will write to me to make some projects.
It's like "Looking for friend that codes in c++" kind of post. (I'm not very active, sorry for bad english)
int main() {
string happy = "24 1.99 42";
int loc = happy.find(" "), loc2 = happy.find(" ", loc + 1, loc + 5);
cout << "LOC 1: " << loc << endl;
cout << "LOC 2: " << loc2 << endl;
return 0;
}
So I am attempting to find the two locations of the spaces
My first value comes...
Aman is playing a game where he has integer numbers as the data in each node and the data in each node is distinct. He traverses the whole list but prints only first occurrence of even numbers in the list. He traverses the whole list till he prints all the even numbers in the list
Input Format
5...
Construct an Item class that stores the code and price of an item. This class should create the possibility of creating objects with and without parameters, to return the data of an item and set new values for them. Placement of values can be realized only within the class or by the classes that...
Hi, guys! I have been working on my Robot Sumo project for months and it still doesn't work and i can't tell why is that. My project is due tomorrow so i'm in need of urgent help.
I use an Atmega328p, programmed with Atmel Studio 7.0, as a processing unit and two tcr5000 line sensors, one on...
Hi guys.
I want recursively copy files and folders with files inside. If folder do not exist, just create it. I just made this code:
CStringArray strArray1;
fnGetAllFilesNames(strArray1);
CString slashs("\\")...
Hi, I'm making a little game for a college project.
I was asked by the professor to implement a pathfinding system. He also recommended a site to get the code from https://www.redblobgames.com/pathfinding/a-star/implementation.html. So I took the code, adapted it, translated the comments into...
Hi! Can someone translate this code from c++ to php?
#include <cstdio>
#include <algorithm>
#define REP(a,n) for (int a=0; a<(n); ++a)
using namespace std;
#define INF 1000000000
typedef long long LL;
///////////////////////////
#define MAXN 1000000
int wagi[MAXN];
int orig[MAXN];
int...
Hello All, I am new in c++ programming and I am stack in gcd of two numbers problem. The problem statement is two non-negative integers a and b, we have to find their GCD (greatest common divisor),i.e. the largest number which is a divisor of both a and b. It’s commonly denoted by gcd(a,b) I...
"You can start thinking so long how you would handle the periodic calculation and graphic representation of something that you are simulating in real time. It will not be bouncing anythings this time." - We are writing a test on C++ in Qt Creator 5 soon and our lecturer has given us this hint of...
i am creating a program that is coded in c++ in visual studio and don't know how to connect to MySQL server that is hosted by the university on myphpadmin
will someone be able to show me the code I would use to connect to it?
Hello, Currently I am prepering for competition on national level. I have found some tasks from previous years but I dont know how to solve them. It would really help me a lot if somebody could help me out :) By the way I am high school student. Here is a problem on which I am currently woring on:
Hi I am very new to Arduino and I am having trouble with some if statements I made. I keep getting the error "request for member 'read' in 'file', which is of non-class type 'int'", for each of my if statements. The goal was to make the if statements run when a character in the added text file...
I'm new to C and C++ programming, can anyone give me a hint on what I'm doing wrong here. I'm trying to write to concat function that takes to pointers to chars and concatenates the second to the first. The code does do that, but the problem is that it adds a bunch of junk at the end.
For...
What is a cpp class an how does it work. In java and c# a class(marked as public) is pretty much just a source file, or a public class is associated with a source file, for example:
Program.java:
public class Program{
}
Or
Program.cs:
public class Program{
}
Or I can have some not...
if i have a function f(n)=3+8+14+24+⋯+(n2−1)
how do i implement this into a function recursively without using tail recursion?
it needs a static variable used also
thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.