Beginners - September 2020 (Page 5)

Function Calculator. Help will be appreciated
Write your question here. I am new to c++ and as an assignment we were tasked with making a simple calculator using the function statement. I keep receiving th...
Sep 19, 2020 at 3:37pm
[5 replies] Last: Ah sorry if I haven't responded to any of your replies. I'm still lear... (by AeroRaven)
by momof4
How does a vector resize work?
I'm trying to recreate the standard vector class, but I'm having a hard time figuring out how the vector does its resize. How do I allocate more memory after I'...
Sep 19, 2020 at 1:52pm
[8 replies] Last: Just look at the source code of std::vector The problem is that when... (by dhayden)
Execute the function on the entire character string (1,2)
Hello I have a function to detect comma numbers in a string and convert them to a double variable but I can't make it recursive for all the numbers present? how...
Sep 19, 2020 at 9:25am
[30 replies] Last: I thank this forum without which I would have spent more time to under... (by annolliwohe)
Sieve Of Eratosthenes C++ Using Set Help
As suggested in the title, I need some help with my Sieve of Eratosthenes program to remove multiples of prime numbers. I figured that line 16 would help me the...
Sep 18, 2020 at 2:22pm
[10 replies] Last: Here is a version using the set exclusively: #include <iostream> #inc... (by dhayden)
by Mif
Help with for loop
Hi.. I have this code which delete a specific line from a file and it's working but before asking the user to delete a line I choose to print the content of ...
Sep 18, 2020 at 1:41pm
[17 replies] Last: For an alternative to fgets(), consider: #include <stdio.h> int fg... (by seeplus)
member functions and inline
Hello, I am learning about inline functions and I was hoping someone could clarify something for me. The book I am learning from says that all functions declare...
Sep 17, 2020 at 9:07pm
[3 replies] Last: If the member function is declared inside the class and then defined l... (by dhayden)
Name Format Assignment Trouble
In this assignment were supposed to take the first middle and last name that are input and format them a certain way. For example Pat Silly Doe would format to ...
Sep 17, 2020 at 8:54pm
[10 replies] Last: Ideally, you should account for names that are just one word, or sever... (by dhayden)
by nakash
anagram c++
im trying to make a anagram finder. where it request the user of a word and searches the vector words to find all the anagrams of that word. i think my logic be...
Sep 17, 2020 at 8:42pm
[12 replies] Last: No problem. I thought I might have missed something that caused duplic... (by dhayden)
Problem with dynamic array of structs using pointers
Hello, I am in a class where I have to receive values from a file (a string, an int, a dynamic array of floats, and a dynamic array of strings). I have to setup...
Sep 17, 2020 at 7:27pm
[4 replies] Last: Thank you all for the reply. So some of you asked what the input code ... (by GreggoryLewis)
Linking my static library
Hi, I have written a C++ library as a beginner project. I have created a Makefile with the instructions to compile the code as a static library (make static) an...
Sep 17, 2020 at 5:18pm
[4 replies] Last: Okay I found the problem. I had never built a static library with C++.... (by albertBcn92)
damage algorithm for simple game
I'm having issues calculating damage from a small game I wrote. Every time the player or enemy attack, the damage gets reset so no one ever dies. The problem is...
Sep 17, 2020 at 5:14pm
[13 replies] Last: That's clever. I find that while tutorials are nice, they don't seem t... (by levilone)
c++ issue with using commandline inputs in a forked execvp
When running the code below I get an incorrect output. I am fairly sure I am doing something wrong with the execvp call as I have tried changing everything and ...
Sep 17, 2020 at 2:58pm
[6 replies] Last: ne555 yeah -ls -l is a typo that I thought I removed all instances of,... (by Volapiik)
Checking to see if a Folder Exist
I am writing a little program to do some functions on some PC our company sells. The PC have a security feature that locks them down to prevent tampering. How...
Sep 17, 2020 at 1:41pm
[3 replies] Last: coder777 if I remove the last backslash at the end of the path the who... (by Vendetto)
Multithread - Finish one 'for' interation before continuing?
Hi everyone, i'm making my own raycasting engine and it's well functioning, sprite, ai and everything else. In order to raise the framerate i've discovered the...
Sep 17, 2020 at 9:37am
[4 replies] Last: Yes, i intend a vertical scan line, it can go up to 60fps in 480x300 o... (by LakySimi1)
Compute the average of weighted exams.
I need help on my CSCI-40 assignment. Here is what is asked of me: Suppose a teacher weights the four exams he gives 10%, 25%, 30%, and 35%. Write a progra...
Sep 17, 2020 at 9:15am
[1 reply] : For weighted average, don't code it until you know how to do it by han... (by lastchance)
Infinity comes up as an undesired output
Hello, I am supposed to make a program in c++ that takes user inputs of goals and the shots a person in made in soccer, and then use this information to come up...
Sep 17, 2020 at 7:29am
[4 replies] Last: while (cout << "Enter the number of goals that were scored: " && (st... (by seeplus)
Writing a simple game, having issues with objects
So I'm trying to make a simple turn based game in terminal. I have a header file, and two cpp files. The idea is to make the game highly expandable as a learnin...
Sep 16, 2020 at 6:36pm
[5 replies] Last: The if statement only applies to the theplayer.number(). It doesn't ap... (by seeplus)
by Joello
Reading many lines and separating by spaces on each line
Hey guys so i think all of my code is working except for reading my text file input. The text files will always be formatted with two names on a line, first and...
Sep 16, 2020 at 5:00pm
[6 replies] Last: > getline(linestream, data, '\t'); you never mentioned a tab in the ... (by ne555)
Defining Iterators
I've been working my way through C++ primer and I've been experimenting on my own tinkering with some of the code in the book. It presents this code for a binar...
Sep 16, 2020 at 2:57pm
[6 replies] Last: boom! (by seeplus)
Function pointers
Hi all, There are two functions where in I have use function Validate as a pointer to the PrintNum function. How to use the function pointers. int...
Sep 16, 2020 at 11:41am
[2 replies] Last: Raw function pointers are very C-ish. See also: https://www.cplusplus... (by salem c)
September 2020 Pages: 1... 34567... 10
  Archived months: [aug2020] [oct2020]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.