Beginners - March 2018 (Page 3)

Is it possible to make a variable that is only accessible to certain functions?
 
If I want for example, make a function that returns a value bigger by 1 each time it's being used, like: #include <iostream> #include <conio.h> int ...
[4 replies] Last: If only I knew it was that simple. Now you know it is simple. :D I... (by closed account E0p9LyTq)
Using a Function to read from a .txt
 
Hello, I'm having problems writing a function to pull data from a .txt file. I know my function call has to be wrong, but I'm not quite sure how to issue that ...
[2 replies] Last: Oh derp, I had that set as a float in the original program. I switched... (by LTJska82)
string problem
 
guys im having data types problem on strings #include <iostream.h> #include <stdlib.h> #include <string.h> void menu(); void F_order(char Kod,char f...
[10 replies] Last: Hello helena97, Sorry I did not find this until this morning and by a... (by Handy Andy)
Accept Duplicate Input In Array
 
I create a simple program wherein the program will accept duplicate input from the user. A variable name limit will check if the user exceed from entering a...
[1 reply] : 1. Could you replace the goto with loop(s)? 2. Line 7: you create a... (by keskiverto)
Must use functions
 
Help me change this into functions... #include <iostream> using namespace std; int main() { // declare constant variable PI const float PI = 3.14159; ...
[7 replies] Last: too many else ifs. should use case switch there really. That can be... (by closed account E0p9LyTq)
Trouble with a switch statement
 
I am getting 4 errors when I try to build this program, beginning at the switch statement and am not quite sure what the issue is. Any help would be greatly app...
[2 replies] Last: That did the trick. Just have to tweak it a little and add a default c... (by asteele27)
Assignment help
 
Write your question here. Ok so I have began my assignment my goal is to create a program that will allow me to enter 3 racer names and times and display if th...
[4 replies] Last: Hello austin66887, Good to hear you got it working. If you are finis... (by Handy Andy)
Implementing methods to move elements from one stack to another
 
Hi. I have 3 stacks (bucket1, bucket2, barrel). I want to implement 3 methods that do the following: fill() - fills bucket1 or bucket2 with elements taken fro...
[no replies]
Creating a "fill()" method for my Stack class
 
Hi. I want to implement a fill() method for my own implemented Stack class, that instead of just pushing one element when called, it keeps pushing elements on t...
[3 replies] Last: Nevermind, I figured it out. The loop was endless because I forgot my ... (by ofeliedeceai)
i cant make it return to main choose after making ordering (1,2,3)
 
guys im having problem with the output ,when i make order it doesnt loop it at main choose do you have any sugesstion .seriously please help me #include <iostr...
[50 replies] Last: Hello helena97, To start with, what IDE/compiler are you using? When... (by Handy Andy)
Quadratic equation (Help).
 
When i run this code it outputs wrong answers. For example A=-2 , B=1 , C=1 then x1 = -0.5 x2 = 1. Instead it outputs that x1=1 and x2=1,4013e-045 ??? ...
[3 replies] Last: Thanks @ganado and @tpb I am so blind lol! (by Bakenhuman)
Finding common words from two texts
 
Hi. I'm working on an assignment that asks me to find the common words from two texts(array of chars). I must do this using pointers. I have no ideea how to do ...
[5 replies] Last: Also, is it possible to do it using only pointers? (we can use strtok,... (by ofeliedeceai)
by jen400
Linker problems?
 
Everytime I try to compile I get this error: Undefined symbols for architecture x86_64: "Measure(char)", referenced from: _main in program5-7d9fc2.o "Veri...
[13 replies] Last: it won't run any of the Dmax functions but will ask if the user want... (by closed account E0p9LyTq)
by Manga
This one defeats me...
 
I have been trying to make a program that reads a text file in, then scrambles the text. It works but not on the last line of my text file. Can't figure out why...
[3 replies] Last: Thanks icy1. That was the easiest solution in the world. Perhaps even ... (by Manga)
Newer c++ to old c++ Code
 
How can I conver this to older c++ code. for (BoneAnimation* boneAnimation : mBoneAnimations) { delete boneAnimation; }
[6 replies] Last: How can I conver this to older c++ code. Define "old C++ code," ple... (by closed account E0p9LyTq)
find out
 
i dont understand this flow. anyone would help to find out this solution? 1. write a program to input 5 integar numbers. after the data have been entered, ma...
[2 replies] Last: Hello lhamfi95, The instructions are easy to follow. 1. Get five num... (by Handy Andy)
Debugging in C++
 
How are you supposed to find bugs in C++? I come from a mostly java background. 98% of my bugs are NullPointerExceptions and me forgetting to assign variable...
[4 replies] Last: I use a mixture of techniques... adding print statements (be sure to... (by jonnin)
vector.erase doesn´t work
 
i am working on a program for playing snake and my vector removes the first element just every second passing of the method maybe anyone has an idea to help m...
[3 replies] Last: oh, lol, I also missed that semicolon ;D That would do it! (by icy1)
Inserting something in a string after certain pre-defined characters
 
Hi. I'm working on an assignment which asks me to translate a sentence given by the user into "chicken language"(I think this is only valid in the language spok...
[2 replies] Last: Wow, that was easy! Took me 10 minutes to do it after reading your ans... (by ofeliedeceai)
by cidex
Return vector in function
 
Hello I have to generate three matrices (arrays) that are 5x5 and have random numbers (0-100) by using two functions. First function has 1 matrix and the second...
[5 replies] Last: Thanks @keskiverto for the quick replay. Also to your first comment on... (by cidex)
March 2018 Pages: 12345... 29
  Archived months: [feb2018] [apr2018]

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