Beginners - July 2015 (Page 22)

Program returns weird output
 
#include <iostream> #include <cstdlib> #include <cstdio> using namespace std; int bodyProgram() { int A; cout << "How many activities do...
[1 reply] : at line 123, TPri = i-6 gives the same index every time round the lo... (by Jaybob66)
by mzzz
how to explain this phenomenon
 
hi, every one , i am from china, here is a question about how variables be allocated on memory. my code is as follows, Let me explain it. the complex symbol...
[2 replies] Last: > My question is why not *pc is 0xd2 and *(pc + 1) is 0xce? ... or a... (by JLBorges)
Homework Assignment - Using array of structs with binary files
 
After two days of working on this, I have to raise the white flag. The problem says to create an array of structures (three of them), and write them via binary ...
[6 replies] Last: Thanks so much MiiNiPaa. I appreciate your help...got it working. (by D0CHollywood)
by MrAnts
How to check if array[0] is ""
 
Hi I am coding a terminator for my cmd.exe, if the userinput is "" or "\n" which means the user pressed 'Enter' I have to close the cmd, can anyone help me with...
[5 replies] Last: But you still need to make your array bigger: if you say to getline th... (by MiiNiPaa)
HELP! Data structures
 
Hello, so i need quick help with putting stuff in order. i have a text file: 6 v k 250 m k 280 v p 240 m p 290 v s 63 m s 45 i need to to make this into...
[6 replies] Last: if(A .kaina>A .kaina) { std::swap(A , A ... (by coder777)
How to increase range in C++?
 
Hello, everyone. I thought a lot about increasing the range of integer manually (The long long int is not enough). But I don't find a way. I tried to use BIT...
[2 replies] Last: Thanks, I'll see what I can learn... Maybe I need to use string to hol... (by PSYCHAMERON)
Blackjack-Strategy tables
 
I think I've found a neat way to give my BJ game computer players different strategies without a lot of spaghetti code. Its pretty much just entering the strate...
[1 reply] : What is your problem? It seems to work? (by coder777)
Magic Square Program
 
What am i doing wrong? Why is it not reading in correctly? I get a negative value. Write a program to determine if a 3 x 3 array filled with integers is a Ma...
[3 replies] Last: So you have checked that the actual text file is spelled that way? We... (by CodeWriter)
Help with finding length of an array
 
Hey guys/gals, I'm trying to find the length of an array. The code that I have written up thus far does not compile. There is an error in the int arrayLen...
[4 replies] Last: Yes, it would be a good idea to keep counter denoting how much element... (by MiiNiPaa)
by eons93
Combat simulator game problem II
 
And for once its not an error question. Right now i've run into a problem. As you can see, when the "runcombat()" is started, i initialize 2 characters, a playe...
[3 replies] Last: Something like this, perhaps: #include <iostream> #include <vector> ... (by JLBorges)
Polymorphism
 
If you take a look at line 22, there is a bit of code, "Base &rBase = cDerived;". When I leave out the "&" sign, the program behaves differently and I'm not sur...
[2 replies] Last: @Disch Awesome. Thank you so much for your response. It makes much mo... (by jhykima)
Finding a member in a struct
 
How do you find a member in a vector of a struct? I want to find a particular member name. After I find it I want to delete it. // C21Drill Vector #inclu...
[4 replies] Last: Thank you all. I tried the three solutions, and all three work. I ca... (by phztfte1)
by Kew
expected unqualified-id in simple guess number game
 
I am trying to write a Guess number which generate a number for player to guess until the player get it correct. i had checked many time about the code, it keep...
[6 replies] Last: Thank You very much, i got it! (by Kew)
Code won't write to file
 
Can someone give me an idea of why my code won't write to the file SORTED.TXT? It successfully creates the file, but doesn't write the data from the arrays. ...
[9 replies] Last: Ok that looks like the data a previous poster was using for working ou... (by CodeWriter)
Plinko program - error with random
 
Hi, I'm working on a plinko (from the price is right) simulator for my intro to computer programming class. I'm pretty new to coding, so bear with me. Anyway...
[2 replies] Last: Awesome, thanks! Problem's fixed now (by brachburton1)
Reading .txt file
 
So I am writing code which should read a .txt file and use the users input to find various things. IM currently just trying to get the program to enter a while ...
[1 reply] : Add this after your open function if (!din) { cout << "Error: Co... (by Ganado)
input validation loops?
 
Hello everyone, I have a program that is supposed to read from a text file into two arrays. The user will than input the student ID number to get more informati...
[11 replies] Last: Thank you for clarifying that. I like the way you separated the validi... (by jpanther)
How to overload a function?
 
Below I have marked where I am getting an issue on calling my getter function. I was told that I need to Overload this function, how would I go about doing this...
[4 replies] Last: Thank you so much! Will mark it as solved :) (by Outlaw782)
how do I use static casting in my calculator?
 
Ok I have a calculator to build for my project. I have it working like a charm. However the requirements have changed to include needing the numbers to be doubl...
[6 replies] Last: Thank you that worked. (by ironsoldier71)
Pointer to pointer (Linked List)
 
I don't understand how the push function really works. Why do i need a pointer to pointer? And why doesn't it work without pointer to pointer ? Thank you! ...
[1 reply] : A function parameter is either by value or by reference . A by valu... (by keskiverto)
July 2015 Pages: 1... 2021222324... 33
  Archived months: [jun2015] [aug2015]

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