Beginners - January 2014 (Page 15)

Passing Array List pointer to function
 
I'm going to pass my array pointer to the function parameter. I'm quite not sure how to use pointer as array list. Here my current codes... void FunctionA(in...
[2 replies] Last: In reality void FunctionA(int arr_merge ) is void FunctionA(int * a... (by closed account z05DSL3A)
I would greatly appreciate any and all help in making my default constructor.
 
An example of a set {1 2 3} The class Set will have the following characteristics: Attributes: elements (a vector of int values) Constructors: Set()...
[4 replies] Last: That suggests a default constructor that looks something like this: ... (by cire)
Save to binary
 
I can't save my code to binary file, please help. #include<string> #include<iostream> #include<fstream> using namespace std; struct osoba { stri...
[no replies]
I Need HELP!!!
 
I'm working on a Goldbach’s conjecture code, which is that the sum of any number larger than 2 can be expressed by adding two prime numbers. #incl...
[2 replies] Last: Also to mention that is not how you find the next lowest prime :P It ... (by giblit)
Explain SizeOf Number element array
 
Hello,for those who knew how to return number of elements array usually use ' sizeof( arrayNumber ) / sizeof( arrayNumber[ 0 ] ) '. However, I don't quite under...
[2 replies] Last: Use std::extent<> when dealing with types. Prefer the constexpr v... (by JLBorges)
by xkara
Index/Max/Min of a Vector<double> C++
 
I want to be able to figure out the highest and lowest element in an vector<double> and also figure out what position/index that high/low number is currently. ...
[1 reply] : Something like this? #include <iostream> #include <vector> int main(... (by long double main)
what is this line for
 
I am looking over a code for opening a file but i don't know what this line is for what is fstream fin std::fstream fin("script.txt", std::ios::in); if...
[5 replies] Last: Alright thank you i understand know thanks for the help (by ProgramMaster)
by peterj
Don't Understand For Loop Condition
 
Can someone explain to me how the condition for the two for loops works. I don't understand the logic behind it. int main() { string namearray ; ...
[2 replies] Last: As NT3 points out, there's a serious problem in your code. You should ... (by qmzh85)
for loop help
 
I am trying to let the user redefine variable int yn; to be able to stop the loop when the user inputs a value other than 'y'. It doesn't want to let me do tha...
[3 replies] Last: As long double main points out, you should define yn as char instead... (by qmzh85)
Have to code a selection sort.
 
So I am in class, and we are supposed to create a selection sort using a class List. He is very specific about all the functions he wants in the class, etc. I a...
[1 reply] : void Sort(void){ int eol = count -1; while (eol >= 1) { i... (by ne555)
Dynamic array passed to function by pointer
 
Howdy all, Thanks for helping out and taking a look at this with me. I'm currently using MS visual studio 2010 and am getting these compile errors: Err...
[3 replies] Last: int numScores = 0; float *testScores = new float ; //allocate stora... (by ne555)
Compile problem
 
I can't compile this code, where is a problem? #include<string> #include<iostream> #include<fstream> using namespace std; struct osoba { strin...
[3 replies] Last: Hmm...didn't I already answer you back in your other topic? http://www... (by long double main)
Tic Tac Toe, Need Help
 
Whenever I run the code, It asks for the players names, player 1 then 2. Then asks the player that wins the coin toss to make a move. Then the next player goe...
[2 replies] Last: The logic of your GetStatus function is entirely incorrect. For exampl... (by yulingo)
std::sort() for arrays
 
Could you use std::sort() for arrays. I've only used it when i was trying to learn vectors but didn't understand vectors. And i don't understand how to sort arr...
[19 replies] Last: You're right, Nathan2222, I have the same book. I used it as the basis... (by CplusplusAcolyte)
Explinations needed
 
Could someone explain to me the scope of variables and just explain functions in general I was trying to use functions as seperate sections of my program but w...
[3 replies] Last: ok thanks that fixes some of the problems ive been having (by lolikilu14)
Guess Secret Number Game
 
Hi, I'm very new to coding and can't figure this out. I need the program to have a secret number the user has to guess between 1-10. However, I need the program...
[1 reply] : You'll need a new variable to keep track of how many tries the user ha... (by long double main)
I want to pass a static int into a function
 
Hey everybody, I'm writing a program in which one of my functions will only do something if the function has already been called at least once. I want to do...
[1 reply] : You don't need to (and probably shouldn't) pass in the variable from m... (by Disch)
Programs
 
What is wrong with following code? (isn't compile) #include<string> #include<iostream> using namespace std; struct osoba { string imie, nazwisk...
[2 replies] Last: Please use the code tags in the future. I think the problem with the ... (by Garion)
Writing a program that inputs a character, integer, and float type and then outputs the values.
 
Hey everyone. I'm taking an intro C++ class online, and my first assignment is to write a program "that inputs a character, integer, and float type and then out...
[3 replies] Last: Thanks guys! Will do! I appreciate your help.. (by mattrye)
Just starting out,
 
Hello everybody, im currently just starting out to code in C++, i have currently gotten my hands on a copy of Programming, principles and practice with Bjarne ...
[3 replies] Last: Ok, then i guess my best solution would be to wait and see for myself,... (by skafte13)
January 2014 Pages: 1... 1314151617... 44
  Archived months: [dec2013] [feb2014]

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