Beginners - March 2016 (Page 30)

by rantiv
Help me fix my code!!
 
You should prompt the user to input either 1 or 2, signifying they prefer either the first or second restaurant, respectively If the user provides a response t...
[no replies]
Execution Time Measurement
 
Instructions: Your task is to adapt the files to a solution that finds the maximum and minimum execution times of the Fibonacci number computation routines for...
[2 replies] Last: // FiboImps.h #ifndef FIBOIMPS_H #define FIBOIMPS_H unsigned long i... (by FrostyPine)
Good C++ books for people with (some) programming experience
 
I've been programming now for quite a while. I started with HTML, then Python, and now C++, which, i find to be the best. The problem is, I feel like I am not i...
[2 replies] Last: Thanks for the help, I think I might pick up C++ Primer 5th ed. Or som... (by Olchronos)
by ec252
Snake Game Code. Having trouble
 
I am having trouble to get my snake to increase in size by 1 after it eats the food(*) and then the added characters(s) follow the ones in front of them. Here i...
[no replies]
by csnook
Homemade String Class
 
I am attempting to create a driver main for a homemade string class. My program appears to run correctly up to the point it calls the overload= member function ...
[1 reply] : *** WARNING *** strcpy can and will cause buffer overflows if you do n... (by GRex2595)
by noaboa
Minesweeper
 
Hi, I am making a minesweeper game, and have made the bombs and other things. But I have a problem with getting the numbers of bombs next to it. With this code ...
[2 replies] Last: 1. You check to see if the row is out of bounds, but you never check ... (by GRex2595)
Armstrong number
 
I'm currently learning C++ for a class and we have the following assignment. I had my program working perfectly IF the user had to chose a number, but when i re...
[4 replies] Last: Thank you Glyndon, that worked perfectly! (by brendancostner)
Distance in Member Function
 
I'm having problems implementing the euclidean distance formula in the double distance member function. I've tried everything I can think of. Can someone help m...
[8 replies] Last: It could be more logical to have the distance() as standalone function... (by keskiverto)
Validating a string to only have letters with loops.
 
Hello everyone. I need to validate a string and make sure it ONLY has letters. This is what I have so far and it's not working. No matter what I type, I don't g...
[15 replies] Last: Your return true is STILL in the wrong place. Consider if the firs... (by AbstractionAnon)
SFML Installation Problem
 
I'm having a problem with part of the Window part of SFML. I can create windows and I can use window.isOpen window.pollEvent window.display(). But window.clear(...
[3 replies] Last: Line 1: This may not be the case, but might work: change #include "SF... (by Aethirius332)
I inclue the file but the function could not be seen
 
Hi every one I really appreciate If you can help me in this problem. I have a page called s.cpp with a function in it called "calculate" like below floa...
[9 replies] Last: I'm asking about the code that calls calculate(). It needs to call ... (by MikeyBoy)
constness dilemma
 
Hello forum, I am getting a constant reference of a struct as follows: struct segment { std::vector<Line> lines_; } std::vector<Segment> segme...
[1 reply] : Why are you using a const-reference when you plan to modify the segmen... (by Peter87)
Identical vectors
 
Hi All, I've created a code that prompts the user that the vectors in the main function are identical or not. Now I'd like to make this a function where it ...
[4 replies] Last: Excellent. Thank you. (by honda933)
displayText problem with loop
 
I'm writing a program to read from a file ex: 1 2 3 and display it backwards. Everything is working fine, except for my displayText function. Any suggestion on ...
[2 replies] Last: Thanks for pointing that out. I was able to do what I wanted. (by aerichsen)
Structs as Arrays
 
I have a nested loop in my user-defined function INPUTPROD that terminates after the first run. I cant seem to understand what causes it to terminate. Help Pls...
[1 reply] : Lines 17-20: How many occurrences of the member variables do you thin... (by AbstractionAnon)
Gauss-Jordan Elimination Inverse Matrix
 
This is the calculation part of my code. Other parts are just inputting and outputting so I don't post here. My problem is that sometimes, the output I have is ...
[3 replies] Last: Ah Good :+) I am sorry, I made a big assumption about that. But this... (by TheIdeasMan)
by BrentY
Only one choice working in choose your own adventure game.
 
I am making a "choose your own adventure game" and currently most of it is working. The game has two choices for the player to choose from. Whenever the correct...
[6 replies] Last: Because using namespace std; drags in an enormous number of classes ... (by Moschops)
by Atton
A File System Problem
 
I have a little question as to why this doesn't work. There are no compiler errors and the encode function is for xor. Any ideas? void encodeFile(string inpu...
[4 replies] Last: From C++11 a string does use a contiguous block of memory. In earli... (by Chervil)
by cbar
integer to calculate pi
 
hey guys, have to design program to prompt for integer that represents the # of terms to use for an approximation of pi. The program I wrote runs, it just runs ...
[1 reply] : Please use code tags. They make reading and commenting easier. See htt... (by keskiverto)
Grading Program infinite loop.
 
#include <iostream> #include <string> #include <time.h> #include <algorithm> int main(){ std::cout << "Click a to start,b to exit."; char aOr; s...
[2 replies] Last: This is because, the value of aOr is never equal to'b'. So, you have a... (by hiphop12ism)
March 2016 Pages: 1... 2829303132... 47
  Archived months: [feb2016] [apr2016]

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