Beginners - February 2022 (Page 5)

Inventory management file processing question problem
 
I have successfully worked on the file tool management for the functions but dunno how to do with file processing of sequential file txt or random access file d...
[6 replies] Last: OK, As a 2nd refactor, this will first read the data from hardware.txt... (by seeplus)
Unable to print array
 
Can someone help why my array is showing junk values on print int main() { int arr = { }; int i = 0; int x = 0; cout << "Please en...
[12 replies] Last: Atom using GPP invokes MinGW. Chances are when you compile you are no... (by George P)
by Hcarr2
if else statment outputting 2 outputs
 
im making an if else statement program determining the eligibility of an applying student. my output for student - 2 keeps saying "wow!is this for real?We would...
[3 replies] Last: #include <iostream> using namespace std; int main() { int stude... (by againtry)
Infinite Loop
 
I have an infinite loop and I'm trying to figure out where's the error //Include the following #include <iostream> #include <string> #include <fstream> //y...
[1 reply] : The only thing that could cause an infinite loop in your code is bad d... (by DizzyDon)
help with my code
 
I have been working with this code for at least two weeks for a class. I am wondering if anyone can show me what i am doing wrong? Will be grateful for help. ...
[3 replies] Last: yes thanks for this guys much appreciated. (by Paul50002)
c - seg fault?
 
My program parses the string 'Ge34eks-f10or-Gee59ks' and splits them into tokens of three Ge34eks, f10or, Gee59ks. For each of this tokens the goal is to extrac...
[4 replies] Last: Thanks for all the suggestions! The problem indeed was with the index.... (by Volapiik)
take input from user
 
I just made a small program to take input the stations for one road need some help to complete the bool roadReadData(Road & road) function #include ...
[4 replies] Last: Not which function - which function requirement ? You've listed seve... (by MikeyBoy)
by guack
I cant get last position
 
#include <SFML/Graphics.hpp> #include <SFML/System.hpp> #include <SFML/Window.hpp> #include <iostream> #include <vector> sf::Vector2f SNAKE_SIZE{15.f, 15...
[10 replies] Last: when i try your code the snake rotates faster than it moves (it is act... (by guack)
by mikef
Loop prints only the first vector element
 
I'm generating random numbers and adding them into a vector then printing the numbers in the vector but it shows me only the first number. When I put a breakpo...
[11 replies] Last: I was going to add an additional comment that mentioned using reserve ... (by George P)
Struggling with a beginners homework assignment if anyone can help!
 
I am working on homework and have spent a few hours but can't figure out what is missing from this code. I would appreciate any help to point in the right direc...
[6 replies] Last: Another way is to write the program only after considering the problem... (by againtry)
c - my program doesn't print array?
 
My program has the goal of parsing the string "Ge34eks-f10or-Gee59ks". It does this by using strtok to split on delimiter '-' into three tokens Ge34eks, f10or, ...
[1 reply] : [Continued here http://www.cplusplus.com/forum/beginner/282144/ ] (by seeplus)
Trying to get a led to blink slower and slower
 
I got a kit offline from freenove trying to learn. Im so new it hurts I just want to get my led to blink slower and slower by one second. Its not working what a...
[5 replies] Last: https://docs.arduino.cc/learn/programming/functions https://www.arduin... (by againtry)
Help Needed With Loops
 
So I'm about one month into my C++ class and we just started learning about loops but for the life of me I cant wrap my head around how to write the code the pr...
[4 replies] Last: The requirement for 1) is to use a while. Also the logic isn't what wa... (by seeplus)
by emcp
cannot access derived class from base class when using factory
 
I've got the following code, trying to access functions that go beyond my base class.. When I do the compiler states it doesn't see my derived class functions...
[3 replies] Last: According to the documentation I think it's supposed to be this: c... (by coder777)
Index of the first character of the last name
 
Hi, im new here, and im struggling with a hw assignment that asks me for: a. The index of the first character of the last name b. The first 3 characters of ...
[1 reply] : For the lastname: the first index is the length of the firstname + 1,... (by thmm)
Stack around array was corrupted
 
I've nearly finished with my classes knight tour program but I keep getting an odd error saying the stack around my chessboard 2d array was corrupted. I've trie...
[6 replies] Last: It looks like the test for bestHorizontal == 10 needs to be moved back... (by DizzyDon)
Need help with code/cin please
 
I'm working on a project for school. It's supposed to work for male and female, but I am running into a problem where entering "F" at the first cin shows both...
[2 replies] Last: You also have a semicolon at the end of line 26 that shouldn't be ther... (by DizzyDon)
Explain about a piece of C code
 
Hello, Could you please explain the below code? Why do we have these results? #include <stdio.h> int main() { int i = 0, j =1 , k =2 , m; m = ...
[2 replies] Last: Get out your textbook and/or course notes and read about the operators... (by Duthomhas)
OpenCV C++ issues
 
Hello good fellas! I have two questions: 1. How to output all contours contains? If i set loop condition to 6 it gives segmentation error. 2. How can i outpu...
[1 reply] : Does this even compile? std::vector<std::vector<Point> >contours; .... (by salem c)
c++ read string
 
assume we have this struct and we need to take data from user , the type of the car and the car number, how can we read line nr 2 below, and how to read the cod...
[9 replies] Last: #include <iostream> #include <string> #include <vector> struct Car... (by againtry)
February 2022 Pages: 1... 34567
  Archived months: [jan2022] [mar2022]

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