Beginners - November 2012 (Page 58)

by Hotice
A function like this one won't return two values, right?
 
Just wondering if the language will know that I intend to return ONLY ONE VALUE. Here is my function (I have a sentry variable, but was trying to avoid adding a...
[3 replies] Last: Holy crap, I overcomplicated this! Thanks, guys!! (by Hotice)
by G3PO
Factorials: Iterative vs. Recursive. (1,2)
 
I'm currently trying to make programs that will use an iterative and recursive solution for the factorial using the formula C(n, r) = n! / (r! * (n-r)!). I'm...
[21 replies] Last: Woo! I got it! And with three minutes to spare! Here what I ended with... (by G3PO)
Anyone any good at explaining linear probing?
 
I need some help writing a function that displays the collision technique using linear probing. I have had an extreme amount of difficulty finding sources onli...
[no replies]
reverse strings in an array
 
I am trying to write a function that does the following: int flip(string a , int n); Reverse the order of the elements of the array and return n. For...
[4 replies] Last: Your code is invalid. Consider n equal to 3.:) I am sorry. It seems I... (by vlad from moscow)
Problems with classes
 
I am making a card game. I have a class for the players hand. Constructor: Hand::Hand (int size) { card = new Card ; handsize = size; elem = 0; } ...
[3 replies] Last: Thanks for the help guys! (by musicgp)
by Hotice
Different instances of the same class
 
This is the question I should have asked WAY back in the day, when I first got an account here: Is there a way for different instances of the same class to acce...
[8 replies] Last: I answered my question by trying it myself. I decided not to delete th... (by Hotice)
Linking/compiling a header file
 
I have two cpp files, one with the main code in and one with the definition of a class and its member functions. The class is declared in header file. When I...
[1 reply] : Normally, you just need to add both solutions to the source file witho... (by Stewbond)
by ygh929
Program received signal: “SIGABRT”.
 
I just wrote a very simple class.. However, I met some problem.. I want to construct a skip list in c++ and I need to write "node" first. In the node I need to...
[3 replies] Last: When is a proper time to call that? As a very very good rule of thu... (by Moschops)
by zakkor
Prime numbers problem
 
I have no idea why this program of mine doesn't work. #include <iostream> using namespace std; int a, nr, n; int main() { cin>>n; for(int i=...
[6 replies] Last: For a number to be prime, it can't be divisible by any number less tha... (by ResidentBiscuit)
C++ help with an assignment
 
Im fairly new to c++ and need help with my assignment in school. Can anyone please show me how to program this? Write a C++ program that models an airplane....
[9 replies] Last: If you take notice of what I said in bold earlier, then I might be pre... (by TheIdeasMan)
Creating a Test Input File
 
Hey all, I'm currently a student in college, taking the first of many programming classes. So far I understand c++ a good amount and am catching on pretty qu...
[4 replies] Last: tmort92, here is my take on your assignment. I've appended some more ... (by LGonzales)
Sorting coordinates
 
My algorithm is unable to successfully sort input in ascending order of the magnitude of hypotenuse from the origin. Please advice on my code written below, tha...
[1 reply] : Just add an operator< function to your point structure and compare t... (by Stewbond)
expected `(' before '{' token
 
Hi, this is a simple program to calculate a payroll, excuse my lack of comments. It's giving me the error in the subject, and: expected primary-expression befo...
[3 replies] Last: else if is missing a condition. you forgot tax == 'n' (by Darkmaster)
C語言新手
 
請問各位大大們 我對C語言有興趣 但是不知道該從哪裡著手 可以給點意見嗎??
[6 replies] Last: ¿Shouldn't you blame your browser? +1 @ This. (by Disch)
Java-like functions?
 
I was wondering, i'm making a console game, and want to write string letter by letter. instead of copy/pasting my letter-by-letter code all the time, can i make...
[4 replies] Last: Excactly. Thanks for the help! (by sanoj00)
Visual C++ 2010 IDE, a few questions
 
Hello I just registered on this lovely site and i need some basic help. I have been on the IT scene for 15 years but only recently (2 years ago) obtained ...
[1 reply] : I don't know much aboutthe mfc, bu I know that Microsoft has a site de... (by pogrady)
cin.ignore(numeric_limits<streamsize>::max(), '\n');
 
What does this line actually do? cin.ignore(numeric_limits<streamsize>::max(), '\n'); Thanks
[2 replies] Last: Forgot to reply. Thank you! (by rkstengel)
Transcendental Function Implementation (need help with output file now)
 
Hi, i have a project to do in my intro to computer science class, and here is the description. You are to write a C++ program in Visual Studio 10.0 (VS 2010...
[11 replies] Last: Also, you should not use double variables in a for loop like this: f... (by TheIdeasMan)
Operator Overloading [] & =
 
I know how to overload operators now, but now I want to know if there's an operator function to combine the and = operators to change the value of an enca...
[9 replies] Last: You would only need to do that if the implicitly defined operator= isn... (by Peter87)
November 2012 Pages: 1... 5657585960... 75
  Archived months: [oct2012] [dec2012]

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