Beginners - February 2019 (Page 6)

by Majeek
Delete An Element From An Array
 
How would I delete "Bloodhound" std::string LegendArray = { "Bloodhound","Gibraltar","Lifeline","Pathfinder","Wraith","Bangalore","Caustic","Mirage" }...
[4 replies] Last: alternate answers: 1) just kill it. LegendArray = ""; //its gone. w... (by jonnin)
square root finder without using sqrt
 
I'm trying to write a function but it keeps telling me at the end of the function "control may reach end of non void function" what can i do to fix this? ...
[2 replies] Last: the smart * in me says pow(x, 0.5); :P otherwise there is enough here... (by jonnin)
Unable to understand the breakpoint due to deletion of pointer array
 
Ok, so I am making a program in which I will be creating functions of different string operations. I have made some and they are working fine as well. However...
[3 replies] Last: You haven't posted your routine strcmp, so the code won't compile as-i... (by lastchance)
Snake game border repeatedly prints
 
I am just starting out with C++, and I'm trying to code the game snake - when I compile and run the program it keeps printing the borders of the game over and o...
[1 reply] : [quote=Apolcalypticname]I don't know what to do to only print it once.... (by lastchance)
Cell counting with opencv and c++
 
Why doesn't this program (based of a coin counting program) work? { #include "opencv2/highgui/highgui.hpp" // highgui - an interface to video and image ...
[1 reply] : I see that in the first line you have { maybe you accidentally put it... (by Zivojin)
by M4rc9
qsort: invalid conversion from ‘int’ to ‘__compar_fn_t
 
Hi all, So I'm working through the book "Think like a programmer", and I'm having trouble with the qsort example. I'm receiving the error: error: invalid co...
[3 replies] Last: Ok, it makes sense now. Thank you both! (by M4rc9)
Reading CSV File
 
I have a excel spreadsheet filled with multiple columns of data and I am supposed to use this data to do some key performance indicators. So far I have managed ...
[4 replies] Last: Hello Andy, thanks for replying. The file is a CSV file but the data i... (by nicholasjb1996)
Looping Menu with Random outputs Problem
 
It seems that I am having a problem with this line of code. The case label value exceeds the maximum value for the type. The looping of the menu is not ou...
[1 reply] : number == 1 and number == 2 evaluate to bool. You're only supposed... (by Grime)
Validating IP Addresses
 
Good evening good people, I was given a project to make a basic C# IPv4 address program (WPF). We are to have 5 text boxes (4 for each octet, one multiline tex...
[2 replies] Last: I sincerely apologize, I'm still new to this! (by mysticcq)
Code Errors - unordered_map program
 
In class we were assigned this problem: https://open.kattis.com/problems/anewalphabet And we're required to use unordered_map to do it. After a ton of research...
[9 replies] Last: Ahh okay, whoops I should've noticed that too. Although the output i... (by PiggiesGoSqueal)
by Majeek
Assign Array to Variable?
 
How do I make it so std::string TheArray = LegendArray ; works? I'm trying to make it cout the output of the randomized array as shown below. void Remov...
[3 replies] Last: Several things, first srand() should only be called once, usually in m... (by jlb)
encryption
 
Hi, this is an encryption program. It seems to run, as a matter of fact, the command prompt opens and after allowing me to input a string, I obtain the de...
[1 reply] : > char alph_cipher ; This has 25 elements. > for (i = 0; i <= 25; i++... (by salem c)
by cash
my code is not running
 
My code that has to do with pointers is not running properly for some reason? #include <iostream> #include <iomanip> #include <assert.h> #include <stdl...
[2 replies] Last: > int f1; > int f2; > structure_pointer f3,f4; Utterly meani... (by salem c)
2d array
 
Can I control only the row in a 2d array? I am trying to use flat sorting in a 2d array, where I should sort the array descendingly according to one particular ...
[4 replies] Last: I do not know that are you trying to do in this code.You can tell your... (by Zivojin)
Errors in Code - Structures & arrays
 
I was assigned a problem for class, and even though the due date has passed and I kinda doubt I'll get credit a month later, I would still like to do it for the...
[2 replies] Last: ====================================== Update: Figured it out with the... (by PiggiesGoSqueal)
2d array
 
Can I control only the row in a 2d array? I am trying to use flat sorting in a 2d array, where I should sort the array descendingly according to one particular ...
[3 replies] Last: This isn't very generic, and isn't a 2D array, but might help. #incl... (by Ganado)
Help with functions assignment
 
Hi I am new to C++ and I am stuck on this assignment so I need help Write a program which uses functions to compute some information about a car trip: Fun...
[3 replies] Last: If the name of the function is mpg, and it takes in an int and a float... (by Ganado)
by r0k33
i cant get this simple code working
 
im like really new and im watching this tutorial and im copying his code his code worked just fine but mine says that 'cout': is not a member of 'std' and i don...
[3 replies] Last: Hello r0k33, As I suspected the #include "pch.h" has to be the firs... (by Handy Andy)
A map with a struct as it's key
 
I wrote the following: struct N { long double x; long double y; long double r; friend operator<(const N &T, const N &Z) { ...
[4 replies] Last: Thank you! (by arczi w)
by Alb13G
if/elseif/else % division program problem
 
Im having a problem with the evenly divisible by both 3 and 5, display "WooHoo part. if I enter a 9 it will display woo and a number evenly by 5 will display h...
[13 replies] Last: lookup tables solve so many annoying problems very efficiently (easy t... (by jonnin)
February 2019 Pages: 1... 45678... 23
  Archived months: [jan2019] [mar2019]

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