Beginners - March 2015 (Page 24)

by hmlwin
Program is always giving same output
 
I am having some issues with assigning a's and b's new values, using there old ones to calculate them. My program output is always a=2 and b=1. Can anybody hel...
[2 replies] Last: oh crap! I can't believe i missed that! Sorry sometimes when I type fa... (by hmlwin)
Problems about running the user-defined times of programs
 
Hi folks, I'm doing some program about the craps game(rolling dice) and it seems just confusing that whenever I prompt the user for input of the number of t...
[2 replies] Last: No I see what is going on now.... I used = instead of == to set the eq... (by FrankRafa)
by alexBB
Segmentation fault. Core dumped (1,2)
 
This is a chunk of code that compiles but does not run. #include <math.h> #include <fstream> // std::ofstream #include <complex> #include <iostr...
[27 replies] Last: Thank you norm b. I will try to sort it all out tomorrow. It is my rec... (by alexBB)
delete duplicates from an array
 
I would like to delete duplicates from an array, I used vector for this problem. I am aware that we can do two for loops but I do not want a solution in O(n^2)...
[1 reply] : O( N log N ): // http://en.cppreference.com/w/cpp/algorithm/sort std:... (by JLBorges)
Searching through a data file to match user input PIN
 
I am am trying to write a program to prompt the user to enter a 4 digit pin. If the pin matches a pin on the pre-recorded data file it should say "Access Grante...
[1 reply] : woudl you mind posting your errors? (by Little Bobby Tables)
Iterating through arrays part 2
 
The problem wants me to print each number that is greater than 21. This is what I have. #include <iostream> using namespace std; int main() { ...
[1 reply] : Change this - for (i = 0; i <= NUM_ELEMENTS; i++) To this - for (i... (by TarikNeaj)
by gelier
Part 2:Basics of Array need help !!!
 
I know how to declare an array, but have no idea on this one. Assume that array named a, contaning exactly 5 integers has been declared and initialized. Wri...
[3 replies] Last: Happy coding! (by TarikNeaj)
by gelier
Basics of Array need help !!!
 
Write a statement that assigns to x the value of the next to last element of the array. 1 #define ARR_SIZE 30 2 main() { 3 int x, arr ; 4 5 6 r...
[4 replies] Last: yes, it worked but it must be x =arr -2; to next to the last number. T... (by gelier)
Iterating with arrays
 
The problem wants me to print the average as well as the sum. #include <iostream> using namespace std; int main() { const int NUM_ELEMENTS = 8; ...
[1 reply] : First, the loop is unnecessary; the result of sumVal / NUM_ELEMENTS ... (by keskiverto)
by Tanner
Some questions(need to know Java)
 
Hi,so let me introduce my prior knowledge before I get into my questions. I "know" Java, know isn't a term I would use if you asked me if I know java in real l...
[4 replies] Last: To expand on question number 1. Import and include are similiar but on... (by Ismael Vazquez)
by SCB3
About outputting Ascii Characters
 
ii
[4 replies] Last: sorted it, it was a int array as opposed to a char and I tried using ... (by SCB3)
loop counter not increasing
 
hi so im having some trouble with my code i made a counter that should display the cycle. counter doesnt start from 1 it starts at 50 and stays at 50. i dont kn...
[3 replies] Last: Your program is full of loops all over, specifically which loop are w... (by godric18)
by davtk8
csv format - PROBLEM - What I'm I missing?
 
I get a weird output from my CSV when entering data values on one line in the console. What I'm I missing? Expected: James Kai, 18.01.1996, London (in CSV...
[3 replies] Last: std::noskipws /*and or*/ std::getline http://www.cplusplus.com/refe... (by closed account SECMoG1T)
saving multi dimensional array as a bmp file
 
I have this algorithm that shows you the generation of a maze step by step and i want to output the final result ( array ) in a bmp image file , nothing too fan...
[no replies]
Random numbers (1,2)
 
Hello. After reading a few threads for generating random numbers, I discovered that this is the right way to use it: #include<iostream> #include<cstdlib> #in...
[22 replies] Last: As a believer in determinism, I cannot accept that anything is ever tr... (by Disch)
"This" pointer
 
Hi, again I try to add two complex numbers using "this" pointer. In "Complex Suma(Complex z)" function the first number is represented by the curent object ...
[1 reply] : Your Suma function is fine. The problem is you are adding the 'Add' o... (by Disch)
Add two complex numbers
 
Hi, I am beginner in c++, and i need help. Thank you. #include <iostream> using namespace std; class Complex { private: int a; ...
[4 replies] Last: TarikNeaj i will be more precisely next time. Thank you guys! (by LadyInRed)
Function call requiring endline
 
My function calls below will only return a result if I include an endline after each function call. The functions are all basic get functions (code below). I a...
[5 replies] Last: Thank you very much!!! (by elliott22)
Contact List Program: Can't output all contacts
 
I have a program below that is suppose to allow for a user to import an existing contact list if they have one or create a new one. This works however now I wan...
[3 replies] Last: Works fine for me except that only the first line of the file is read.... (by shadowCODE)
Quick question on global variables.
 
Hey guys, Just wondering, would this count as a global variable? It is currently placed within the private function of my class but I'm wondering if I move ...
[2 replies] Last: Well, it's a typedef, not a variable. So global? Yes. Variable? No... (by Disch)
March 2015 Pages: 1... 2223242526... 51
  Archived months: [feb2015] [apr2015]

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