General C++ Programming - April 2019

by Ryan15
I would like to assign variables in my if statements that will link to my switch statement but I'm not sure how I should do it
 
#include "stdafx.h" #include <iostream> using namespace std; int main() { //Declaring variables int package, quantity,sum; //Initialising va...
[4 replies] Last: Thanks a lot! (by Ryan15)
BST Help
 
C++ Help please, Binary Search Tree I have written some code below, and need help to finish the rest of my assignment, I got stuck. Please extend my code, he...
[1 reply] : > I have written some code below, More likely, you have found some cod... (by salem c)
by hixtus
Simple Tree Code/ Wrong Output Help
 
We've been tasked to create an Octree that has blue and white voxels. However, I've only been able to get the correct answers for Inputs with Level 1 and Level ...
[3 replies] Last: You are passing root by value to Voxels. That means Voxels modifies it... (by dhayden)
help vector::erase understanding
 
So I want to use the vector::erase command to my remove contacts function, but I am kind of new to vectors and I need help understanding exactly how to do this....
[3 replies] Last: One bug fix to fiji885's solution: for (size_t i = 0; i < Names.size(... (by dhayden)
by zak100
Segmentation Fault: Implementation of Gauss Elimination Algorithm
 
using namespace std; void GaussianElimination(double **,double *b ,double *y); int main(int argc, char * argv ) { /* values Row0 = 0, 2, 1; b0= -8 ...
[5 replies] Last: Thanks for your advice. I would try to search the algorithm of partia... (by zak100)
How to solve identifier "gets" is undefined and not found
 
I have problem with "gets" in my program, it's say that my identifier "gets" is undefined and not found. can you help me solve this please? #include <stdi...
[7 replies] Last: I'm curious, did you use fgets() or gets_s() ?... (by deleted account xyzzy)
by Guil
Random global variable
 
Hi, I would like to create a global variable (outside main()) with an random value inside it. Anyway, it doesn 't work with srand() and rand(). Does anybody ...
[18 replies] Last: It would work just fine if you had tried the function I gave you. But... (by Duthomhas)
How can I rotate these 4 numbers each time I run the program?
 
I'm a freshman at my HS taking a C++ class, sorry for bad code or mistakes. How do I make these numbers: 1,3,7,2 rotate numerical orders everytime the program r...
[9 replies] Last: @Grey Wolf Ha -- what a finding! :) Tnx In the OP I read rotate nu... (by MikeStgt)
Random generator and sorting
 
When i run my code a bunch of random numbers print out that shouldn't be there. Can someone please help me? #include <stdio.h> #include <conio.h> #include ...
[2 replies] Last: Thank you for your help. It's greatly appreciated. (by JJLB1981)
by elsa
Using a stack to determine if a string is a palindrome
 
I don't know how to create an isPalindrome() function and not sure if my getString() function is correct. I'm not sure what goes in there or how it would work. ...
[16 replies] Last: thank you everyone who helped me. also thanks to keskiverto to guiding... (by elsa)
by Susie
How I can optimize my timer?
 
Hello everyone! I made a simple timer, but when I run the program, it's laggy. How I can make it run faster, what are my mistakes?: #include <iostream>...
[10 replies] Last: yes, cout is very slow (its terrible on windows and varies from terri... (by zapshe)
by NickB
Username and password code
 
This is a code I c+p, it works perfectly , is there a way I can make it accept multiple usernames and passwords in any order? #include <iostream> #include ...
[8 replies] Last: But whats the problem of hardcoded passwords? You can look at the... (by Repeater)
How to make search program in phone book by number
 
/// Phonebook project //=============================== #include <iostream> #include <conio.h> #include <string> using namespace std; //prototypes void prin...
[1 reply] : You have already posted two threads: http://www.cplusplus.com/forum/ge... (by keskiverto)
How to make search program in phone book by number
 
// Phonebook project //=============================== #include <iostream> #include <conio.h> #include <string> using namespace std; //prototypes v...
[1 reply] : http://www.cplusplus.com/articles/jEywvCM9/ Nobody wants to read 100's... (by salem c)
Ternary Search Trie- Finding all the Strings
 
Hello, I'm trying to implement a TST where each node contains a character and I mark certain nodes as the end of a word. If I want to find all the words in the ...
[1 reply] : Sounds good to me. (by salem c)
How to make search program in phone book by number
 
// Phonebook project //=============================== #include <iostream> #include <conio.h> #include <string> using namespace std; //prototypes v...
[1 reply] : In case 3 you for (i = 0; i<100; i++) if ( person .show(temp_name) ... (by keskiverto)
Need help reading data into 3 arrays!!!!!!!
 
I have to write a c++ program ram to declare 3 arrays, ArrayA, ArrayB, ArrayC, to hold 25 integers each. Write code to do the following –in this order. Re...
[4 replies] Last: I can't use void and need to use two different data files, each conta... (by doug4)
Need Help!! Min, Max, and Ave not correct!
 
So my program keeps displaying weird numbers and the calculations are wrong! I can't seem to figure out whats wrong when i choose the displaystats function. I h...
[1 reply] : Please edit your post to put [co de] tags around your code. ... (by salem c)
Merging two C language codes into one of Arduino
 
Hello, I have two codes in C language which are to be merged and used in Arduino, in order to make the code for a Gate Lock... However, I am not getting as to...
[2 replies] Last: Rename all the functions to be respectively. setup_pad() loop_pad() s... (by salem c)
non static member
 
I'm trying to validate an ip address by calling a method named generalOctecValidation(char* octet), bus as soon as I compile E get this error: src/util/...
[1 reply] : I could fix the error already! (by Lucas Fiorini)
April 2019 Pages: 123... 9
  Archived months: [mar2019] [may2019]

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