Beginners - December 2014 (Page 31)

by mr1987
storing and writing to a Text file.
 
I need help with getting my information to store in the txt file. #include <cstdlib> #include <iostream> #include <fstream> using namespace std; int ma...
[3 replies] Last: Sorry for the late reply. I am very busy with school. We need to dec... (by JayhawkZombie)
Why does this work?
 
I was making a primitive linked list, when I stumbled upon a question. Why does the following code work? Node * curr; Node * head = new Node; Node * ...
[3 replies] Last: @cire, HAHA just figured that out when I gave the code a 3rd look. @... (by Moonraker101)
by Naulee
Palindrome Check With Stack & Input/Output Files
 
I'm having trouble with my palindrome check. I am designing a stack class that is implemented with a vector, so creating the stack functions, use vector functio...
[1 reply] : whats the error? (by hentaiw)
Finding Prime Numbers from 1-100. So close!
 
I'm so close to finishing this program. All need to do is output 2, 3, 5 because those are prime numbers as well(the only numbers left to output). How could I m...
[4 replies] Last: I need to find a way to check for those two parameters and also if tha... (by deathslice)
Clean up code
 
I was told to clean up the code and make it easier to understand but all the teacher did was confused me. Any tips? thanks. These are the steps he asked me to ...
[3 replies] Last: No, not at all. It's just the way he explains things when lecturing. I... (by Newie0001)
Need help on thinking recursively
 
I just wrote a function recursively so I can understand how recursion works, but the logic in this still escapes me. Why does this function display 55 when it s...
[2 replies] Last: Why does this function display 55 when it should display 19, 18, 17, ... (by cire)
Writing from file to array
 
Hello, I need to write from a file to an array. The data in the file is stored as two numbers separated by spaces (tabs). I am having trouble populating the arr...
[4 replies] Last: Nah, stoi seems to not be an ANSI standard. You can always use a str... (by elite zero)
String Replace
 
How do I get my program to replace the parts of my string with whatever the user enters? For example, here I'm trying to put an x into the string pos for whatev...
[2 replies] Last: You just want it to replace the one number, right? If so, the second ... (by manutd636)
by Naulee
Creating and implementing Deque functions
 
I'm writing 2 functions involving deque. The first is to fill a deque with 6 integers alternating what gets added to the front and back. The second is a funct...
[2 replies] Last: So simple. But I am so terrible at programming. Thank you! (by Naulee)
Please help me with the errors in this code.
 
I need help with this code. I get the error c4700 uninitiated local variable "balance" used. line 42 #include "MenuBuilder.h" MenuBuilder::MenuBuild...
[1 reply] : I get the error c4700 uninitiated local variable "balance" used. line... (by Yanson)
Constructors are used to?
 
Write your question here. Initialize the objects Construct the members Initialize the objects and construct the members None
[1 reply] : Instantiate an object of that class. (by elite zero)
Passing my cards to my function
 
So i have this program that asks the user to enter in 5 guesses for a deck of 18 cards. After guessing them, I have to display both the user guesses, and the se...
[no replies]
Question about Null
 
When I try to compile this, an error comes up saying: "a.cpp: In function ‘int main()’: a.cpp:62:13: error: ‘null’ was not declared in this scope ...
[2 replies] Last: Hp of Legend. Thank you so much. You just saved me 25 minutes of tryin... (by jhykima)
Help understanding pointers
 
Can someone please explain to me the switch statement? more specifically, I understand how the data_type switches between int, char, and float, but how does the...
[3 replies] Last: Yes. Lines 54, 58 and 61 call Print_Matrix() but each one passes a poi... (by dhayden)
Classes and variables help?
 
I have a variable called SDL_Renderer* gRenderer. This variable is stated in private, in a header file called initialization. There is a function also declared ...
[no replies]
QUESTION
 
if: const int size1=10; char arr1 ; How can I print out the subscript where a specific element is?
[5 replies] Last: can you apply that to an array? In the first example, is str not ... (by shadowCODE)
"Error in ... free(): invalid next size (normal):... Aborted (core dumped)""
 
Hello, I'm having an issue with this program that's really bothering me. The code runs fine and goes to completion, but I get the error that's in the post titl...
[10 replies] Last: Ok I'll look into it. Thanks for taking a look! (by hyperfine)
Passing/sharing strings between functions?
 
With my code below I'd like to not have to use "string name" as a global variable if I don't have to. I'd like to declare it in the getName() function but be ab...
[13 replies] Last: Ah yes, there we go. All works great now. THANKS! Now I need to figur... (by CGunn86)
I keep on getting "error: invalid conversion from 'const char*' to 'char*' [-fpermissive]"
 
Every time I run it, it would give me "Prob1.cpp:6:9: error: invalid conversion from 'const char*' to 'char*' [-fpermissive] set = rndseq;" can someone...
[7 replies] Last: I just noticed but freq is uninitialized look at your constructor (by giblit)
Need clarification
 
Why is it that these 2 provides the same result for x? given that m = 10, n = 15 x = m - 2*n--; x = m - 2*n; So that I dont make a new topic, this lin...
[2 replies] Last: How come although two of the cout are the same, *(ptr +2), however th... (by Jacobhaha)
December 2014 Pages: 1... 2930313233... 55
  Archived months: [nov2014] [jan2015]

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