1. Hartkeye

    Brand new to coding - First project idea?

    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...
  2. lorli

    C++ How to compile sfml project using cmake on linux

    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)...
  3. A

    Lua Embedded how do I terminate a Lua script outside of the interpreter

    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...
  4. lorli

    Looking for guy to make some projects in C++ with

    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)
  5. J

    C++ Why is this not working properly (.find)

    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...
  6. yashwant_s

    C++ CircularLinkedList-DSA question

    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...
  7. A

    C++ Construct an Item class that stores the code and price of an item. Anyone can solve it for me please?

    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...
  8. S

    C++ URGENT: Atmega328p - Robot Sumo code not working

    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...
  9. J

    C++ How to recursively copy files and folders with files inside ?

    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("\\")...
  10. Lyt

    C++ problems in creating the .h file of an already existing code

    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...
  11. fasjaweasc

    C++ C++ to PHP

    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...
  12. shivambhatele

    C++ GCD of Two Numbers in C++

    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...
  13. maraismarais

    C++ What program could it be that is asked? Qt 5, OOP, periodic calculation and graphic representation of a C++ program.

    "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...
  14. davids4813

    How do i write the code to connect to mySQL on phpmyadmin that is hosted by my university

    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?
  15. A

    C++ I need help with solving problems from previous competitions in my country.

    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:
  16. A

    C++ how to get an Arduino program to identify different letters for If..else statements?

    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...
  17. A

    C++ my code keeps returning -1073741819 (0xc0000005), what is the problem?

    #include <cmath> #include <stack> #include<queue> #include <iostream> #include <regex> #include <vector> #include <thread> #include <bitset> #include <ctime> #include <string.h> #include <math.h> #include <bits/stdc++.h>...
  18. R

    C++ Strcat Function In C++

    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...
  19. Bogdan Floares

    C++ C++ class meaning

    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...
  20. B

    C++ Non tail recursive function help

    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!