Beginners - November 2020 (Page 5)

Passing function pointers to a class without knowing the function signature
 
Hi, I am relatively new to C++ and I am working on a personal project for practicing where I need to create a class that can take function pointers with differ...
[9 replies] Last: a little over my head... haven't ever tried to do this, but .. you co... (by AbdelrahmanSaid)
help with this question
 
Write your question here. Question:You are given a grid as shown in the figure below. You can determine the color and number of each square from the grid. Write...
[6 replies] Last: > Note: You cannot use arrays to store the matrix information. Instruc... (by salem c)
string.h - How can I delete a string?
 
Hi Team, I am a student. I need delete a string, this need work in Linux. We are using string.h but we do not have any coomand as "clear" or "erase", ...
[5 replies] Last: the simplest way to delete a file is to borrow the operating system. ... (by jonnin)
by ga3199
making an arrow
 
Write your question here. I have been working on this all day and can not figure it out. I need to get the end of the arrow shaft to make a point and my arrowhe...
[8 replies] Last: Reminds me of seeing this some time ago: https://www.youtube.com/watch... (by againtry)
How to Calculate Grams to Ounce and Pounds
 
Convert grams to ounces and pounds, if 1 ounce = 28,3495 gram and 1 Pound = 12 Ounce. If anyone ask why 1 pound = 12 ounce not 1 pound = 16 ounce, yes its wron...
[4 replies] Last: Hello siabapet, I would start with salem c's suggestion of working ... (by Handy Andy)
Function display issues
 
Hello, I having some trouble with my countCharacters() function. when i run the program everything works as intended but when I run the function twice as seen b...
[5 replies] Last: it adds both functions together ch_cnt needs to be set to 0 at the... (by seeplus)
Program isn't infile-ing the my infile.
 
So, the problem I'm having is that my functions either aren't opening the file to drag out the numbers or just isn't pulling the numbers at all. I adjusted a sh...
[3 replies] Last: Don't worry, it's a mistake a lot of people make, especially when usin... (by Ganado)
is this bad practice?
 
I am trying to implement sudoku rules in this code for a 2d array. The code works. Logic tells me i am doing a lot of things wrong, but i feel i am a genius. ...
[8 replies] Last: I am not sure what the point of summing a partially filled board is? Y... (by TheIdeasMan)
Undefined reference error: id returned 1 exit status
 
When I try to compile my code by typing 'make' I get the error: Marathon.cc:(.text+0x3e1): undefined reference to `View::validPos(Position&)' Marathon.cc...
[3 replies] Last: Oh, I get it now. You aren't putting ClassName:: before the member fu... (by Ganado)
returning vector indices
 
Hello, I am trying a leetcode problem basically for the first time (tried a few weeks ago and didnt know vectors so didnt get very far). I have just went over v...
[12 replies] Last: Hi, thanks again for all the replies. Some of the stuff I have not cov... (by DonnaPin)
How to split a string into a pre determined amount of parts
 
I am making a function that has to split an inputted string into 3 parts. The string will be inputted in the following format, Book Title|Year Published|Author ...
[1 reply] : If you are able to directly extract user input, you can simply use get... (by Ganado)
ctypea program (1,2,3)
 
I just wanted to ask what is used in this program? is it loop with an if/else? https://imgur.com/a/GuOM0Fd I tried doing it but every time I look down "- ...
[56 replies] Last: Hey guys, I'm sorry I have not posted the clue here but it is said and... (by seghrein2300)
Help with understanding class
 
I thought I had figured out how to create classes, until I had to use numbers in them. The example I was given did not use them, and the problem for my assignme...
[4 replies] Last: Thank you jonnin, I wasn't sure if that's what I was meant to to or no... (by rovert456)
Initiating and printing dynamic 2D array of characters
 
I'm trying to iterate through a dynamically allocated 2d array of characters and initialize all of the spaces to a blank. When I attempt to do this in the const...
[3 replies] Last: #include <iostream> #include <string> #include <vector> using namespa... (by lastchance)
Opening a txt file within a function
 
Hello all, Im having some trouble figuring out how to correctly open a txt file within a function. I understand I need to use ifstream input.file(), but im ...
[4 replies] Last: Without a function: #include <iostream> #include <fstream> #include... (by seeplus)
C++ Reading Records from Disc File, Sorting, and Finding the Average
 
Hi everyone. I hope all is well. I am having trouble with my code below. For my C++ class, my professor has just uploaded an assignment that requires us to r...
[9 replies] Last: @allisonOs See my previous post! (by seeplus)
counting words
 
I have tried the code below #include <iostream> #include <string> using namespace std; // function prototype int countWords(char*); int countW...
[3 replies] Last: As the first post is C++, this can be easily done in C++. If you extra... (by seeplus)
storing data on a .dat file
 
solved it using below the code if someone needs help /* Corporate Sales Data Write a program that uses a structure named CorpData to store the following...
[5 replies] Last: Note changes to the function definitions: #include <iostream> #incl... (by seeplus)
Trouble shooting Nested Loops and statements
 
Having trouble with Odd Portion of this code. I am over looking how I have written the code to have the desired effect which is listed below. Ive nailed the eve...
[7 replies] Last: Hello kidd2100, You are welcome. Glad it helped. Andy (by Handy Andy)
array + struct: extra curly brackets required for initialization?
 
Are extra curly brackets really required when initialize structures comparing with primitive types? It's kind of inconsistent design, can someone help explain? ...
[11 replies] Last: Actually, my advice would be to use a vector - it's more flexible. (by lastchance)
November 2020 Pages: 1... 34567... 14
  Archived months: [oct2020] [dec2020]

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