Beginners - July 2016 (Page 20)

how to create a global 2d array?
 
I'm working on a coding problem, and I haven't used C++ in a while. What I need to do is create a 2d array that I can define outside of the method itself, so...
[2 replies] Last: Is this an assignment where you have to use pointers? If not you bette... (by Thomas1965)
Progamming Principles and Practice Using C++ Book and Question
 
I am currently using the book, Programming Principles and Practice Using C++ and it is great. It is easy for me to understand, and his real world examples and k...
[3 replies] Last: If I recall correctly he used his header "std_lib_facilities.h" and yo... (by etrusks)
Parallel array functions
 
I am having trouble with my extractData function. First, my code is not recognizing the function definition. I checked the spelling and number of parameters, b...
[16 replies] Last: It's all good now just fill in the ????'s. It works! :) (by closed account 48T7M4Gy)
Orc game not looping right
 
Two glitches - 1) Phantom round 2) Seeing "You go back to camp..." line after pressing Y to fight next orc. You find the missing round and the camp line when yo...
[4 replies] Last: All fixed, finally, after spending 1.5 hrs after work playing through ... (by volTron)
Finding lowest number (1,2,3)
 
I have 5 scores, (and I do not know arrays well yet please no array answers) I just need help getting the formula correct and I think I can build the correct to...
[44 replies] Last: I am done with this whole fucking crybaby show you have going if any ... (by closed account 3h0oLyTq)
by Kaisky
Problem with stacked "#include"s
 
Hi! I have a really small problem but no idea how to solve it. So i have three classes "Polygon", "Surface" and "Edge". All three of those classes need ...
[7 replies] Last: thanks! <3 (by Kaisky)
by Tonlee
Why the priority_queue top() Max number?
 
template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> > class priority_queue; I think the priority should b...
[2 replies] Last: http://www.cplusplus.com/reference/queue/priority_queue/pop/ // pri... (by Tonlee)
Creating a function that allocates memory for an array of structures
 
I have a struct called Student which has a pointer to an array of testScores. I need to create a function that returns a pointer to the array of Student Structu...
[10 replies] Last: Oh, good for you :) (by Naughty Albatross)
Good non-xCode Mac compiler?
 
Long story short I'm finding xCode to run into a plethora of issues I do not find at all on standard entry-level compilers (Codeblocks, c++-dev, etc), but would...
[6 replies] Last: FWIW I finished downloading Qt. Me oh my, how fast that 200 years went... (by closed account 48T7M4Gy)
Printing a fraction
 
I'm stuck on one problem of a group that I've been working on and my deadline is rapidly approaching. It's supposed to draw from work that we've done in our pre...
[1 reply] : You don't have a constructor. You should include a 2-parameter/default... (by Arslan7041)
How to TRULY validate basic string input?
 
Is it even possible using cin to "truly" validate input (i.e., prevent user from crashing the program by mashing the keyboard)? Despite my best efforts, this c...
[6 replies] Last: > Cin >> get should be sufficient for 1st year CS student program Of c... (by Naughty Albatross)
while loop fails to run (1,2,3)
 
Not sure what is stopping this while loop from running #include <iostream> using namespace std; int main() { string name; int score, tot...
[45 replies] Last: Great thread title you chose miah while (arguing point) failing mi... (by closed account 48T7M4Gy)
Interdependent classes
 
[Hi, let me describe briefly a problem. I have the following two classes A and B, defined in two header files Afile.h and Bfile.h respectively:] [/ class A...
[4 replies] Last: @AbstractNonsense And that's exactly what the article says. Well done.... (by closed account 48T7M4Gy)
by Magnyz
unhandled throw with a catch(...)
 
I am doing a throw and get an unhandled exception error (VS2012) despite even having a catch(...). Probably I am missing something obvious but I am not sure wha...
[no replies]
order swapping array
 
hi people I know how to swap two indexes in an array lets say the first and second but I'm not sure how I would swap them all I don't mind which order,how would...
[10 replies] Last: Glad it helped :) (by Naughty Albatross)
Reading a file in chunks
 
I am using the following code to read in a file, 1024 bytes at a time. The issue I am having is the last portion of the file is not being read and written to my...
[4 replies] Last: Glad to hear :) (by Naughty Albatross)
by sam80
C++ typeinfo class
 
Hello everyone, Could anyone explain the below please? I know that typeid class has private assignment operator so you cannot assign anything to it. But I see...
[2 replies] Last: Thanks So do you mean that whenever we have a reference in right hand... (by sam80)
by FBHSIE
Logic errors 2
 
http://prntscr.com/brs2kd I finished this program with two logic errors that I can't figure out. The first one is why the doAgain variable isn't workin...
[17 replies] Last: void calValidation1(double &fatGrams, double &amount) { amount=(... (by FBHSIE)
by cojeap
Largest product in a series
 
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 7316717653133062491922511967442657474235534919493...
[3 replies] Last: thanks, didn't occur to me.... now it's solved (by cojeap)
string to char?
 
i want to store the string into char but it wont let me. how do i get around it please ? int main (){ string UserText; int TextSize; char UserChar; c...
[2 replies] Last: A char can only store one character of your UserText. You can convert ... (by Thomas1965)
July 2016 Pages: 1... 1819202122... 30
  Archived months: [jun2016] [aug2016]

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