Beginners - February 2022 (Page 2)

by bfears
How to pass an array to user function.
 
I need create an array and pass it to several different user defined functions and then pass that information back to the main to be displayed. I have found you...
[7 replies] Last: the function has no way to "know" the size – unless the size is fix... (by seeplus)
by AAAbb7
Substr()
 
I'm not sure how the substring input works. I have this code snipet: if (validNum(input.substr(i, 2))) { ++validCount; ...
[1 reply] : See http://www.cplusplus.com/reference/string/string/substr/ The i is... (by seeplus)
Catching Exception for deleting null pointers
 
I am studying exception handling in c++ and I run across this problem. So I have a pointer that is uninitialized and tried deleting it. When I ran the code ...
[4 replies] Last: Thank you very much! Kudos for sharing your expertise. (by shaefayejem)
arrays/loops question
 
I'm trying to write code with arrays and loops for a program that allows a user to enter 20 numbers, then displays each number and its difference from the numer...
[2 replies] Last: Thank you so much, i often times find myself using too many semi colon... (by ColeMilla)
How to control two processes with posix and semahrores in C++?
 
Hi Im new to Concurrency and parallelism programming in C/C++ so I need some help with my project. I want to run multiple process using POSIX and Semaphores ...
[17 replies] Last: Take a look at this: http://wiki.ros.org/roscpp_tutorials/Tutorials/W... (by coder777)
Pointer not printing next value
 
I am not sure, what is wrong with my code.. I was expecting the code to print Child :: 1 Child :: 2 But it is only printing Child :: 1 #in...
[11 replies] Last: Thanks. This is great stuff and something that I have not been seeing... (by shaefayejem)
Reading and printing using class, enum class, default constructors and setters/getters
 
I'm getting loads of errors in printing. I'm also unsure how to use setters/getters. Could someone help? #include <iostream> #include <fstream> #include...
[18 replies] Last: Given that data file, the output from my code above gives: The stud... (by seeplus)
no match for operator>>
 
Hi, so I'm a total beginner and am having trouble trying to overload the insertion operator. When I try it tells me "error: no match for ‘operator>>’ (opera...
[8 replies] Last: The array size is specified at compile time. (by seeplus)
create functions of moving linked nodes (1,2)
 
I have created the main to test the nine functions and the class for the doubly linked nodes Class for doubly linked nodes class Doubly_linked_list // Use a...
[32 replies] Last: Your Insert_at_back() declares the parameters in the wrong order. It s... (by dhayden)
How to code a 2D array rolling algorithm using WASD keyboard control
 
I'm fairly new and I'm trying to display a 2D array rolling algorithm so that I can continuously rotate the display in UP, DOWN, LEFT, and RIGHT directions. By...
[10 replies] Last: Like this. #include <stdio.h> #include <stdlib.h> #define A_WIDTH ... (by salem c)
strings and vectors
 
The numbers I input are not adding at the end. May I know why? #include <iostream> #include <vector> using namespace std; int main( ) { int n...
[3 replies] Last: #include <iostream> #include <vector> #include <numeric> int main()... (by seeplus)
Reverse singly linked list
 
Hello everyone, I have an assignment that I must reverse a singly linked list, and I tried to search on the Internet and found this code but I really don't unde...
[2 replies] Last: pop the top and insert it into a new list at the top 1 - 2 -3 -4 pop... (by jonnin)
Need help with number guessing program
 
I'm trying to make a program where the user guesses a predetermined number in a program with only 10 tries before the program ends. I can't figure out how to ha...
[5 replies] Last: Update: thanks guys! appreciate the help a lot. (by frogovalgoggles)
Loops
 
I'm trying to write a program that repeats a block of code as long as the user indicates they want to. I've been trying to make one using this code but I keep g...
[13 replies] Last: For purposes of being semi-readable I might add some judicious whitesp... (by George P)
I got Errors in C++ when try to use modules
 
Hi I have a python script that read IMU data from the sensor. This is the part of the scrip which get the IMU sensor data import Microcontroller_Manager_Ser...
[17 replies] Last: @Peter87, that is good advice! Though every browser I use, desktop or... (by George P)
Delete Node
 
This week in my class my professor assigned a project where we have to create a program that reads a txt file and using add, delete, and animation turns it into...
[12 replies] Last: To include remove, then possibly: #include <iostream> #include <str... (by seeplus)
read in using getline - empty row at the end?
 
Greetings! In a book (using C++ 14) there was an example about reading from files using getline. I implemented the following method: vector <double> rea...
[18 replies] Last: The book on Amazon has a newer version available now, published a coup... (by George P)
by janac
error impllies the method is static, but method isn't static
 
I'm getting this error: error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers I looked it up...
[8 replies] Last: @janac, I am pleased I was able to help. :) (by George P)
Do we need check SIZE in for loop?
 
Hello, Can I remove i < SIZE ? I think string1 != '\0' is enough condition. because absolutely string size isn't more than 20 #include <stdio.h> #...
[11 replies] Last: With printf() etc, you can use * for a format width to get a width val... (by seeplus)
Help with this program.
 
Hello I've been having to work and rework this program for weeks. I am wondering if someone cn look at and help.It will be appreciated. Here is the assignmentme...
[7 replies] Last: Lol I am Rodger Coleman. It's a made up name trying to stay Anonymous... (by Paul50002)
February 2022 Pages: 1234... 7
  Archived months: [jan2022] [mar2022]

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