Beginners - July 2010 (Page 17)

When declaring new Type[n]
 
When you declare something like type* thing = new type , why does thing have to be a pointer? I feel like I've read it before but I can't remember. ...
[3 replies] Last: Thanks bazzy. (by pabloist)
by kaduuk
Difference cin.get and getline
 
Hey guys, I was wondering, what's the difference between cin.get and the getline function? They're both functions to get an inputted string right? Thanks...
[4 replies] Last: Oh. Right. cin.get ( char* s, streamsize n, char delim ); and cin.get... (by hamsterman)
Basic Guess My Number
 
Hello, I recently made some code for a simple guess my number program. However, if you guess it wrong, it keeps on printing "Sorry, guess again." What did I do...
[4 replies] Last: Your program is set to loop "Sorry, guess again" While var != 42 and t... (by AdventWolf)
Getline for pointers in a structure problem
 
Hello, right now I am working on a problem in a programming book that I have and for some reason I cannot use getline to gather a line of text. I had everyth...
[4 replies] Last: Ah ok, thanks for the help. (by AdventWolf)
decimal places
 
this program is supposed to split an inputted number into 3 decimal places (hundreds, tens, ones) and also the remainder, like the amount of a check. (ex/$123.4...
[7 replies] Last: lol, it would still be a good idea to see how getline, strings and str... (by m4ster r0shi)
by gcr114
recall values from a loop
 
hey guys, bit of a brain fart, i have a program that asks a user to into input how many item prices theyd like to enter, then it asks for each individual pri...
[1 reply] : now that i think about it...i might just use an array.. (by gcr114)
Array don`t work correct
 
Hello everyone! Why this don't work? Someone helpe me please!! The return is: b = 0 b = 1 b = 2 b = 3 b = 5 b = 5 b = 6 b = 7 ...
[2 replies] Last: To follow up what helios said, I recommend that you use constants thro... (by kempofighter)
Is this stuff necessary?
 
I see this a lot in people's code and I'm wondering, is it something I should be taking up on or does it not matter. This: void SomeFunction( ) const; // <...
[6 replies] Last: You can also combine the two concepts like so in order to guarantee to... (by kempofighter)
C++ Vector problem
 
Hi all! I'm new in this forum, I got here after hours and hours struggling with a C++ which doesn't work as expected :-) I have written a little function which...
[3 replies] Last: Thanks for the answers, I finally solved! (by CriogenizedSoul)
Power and Factorial
 
My program basically asks the users for a value (s) then calculates and displays the First, Middle, Last, and Final. The users have a choice to enter the value ...
[1 reply] : Please use code tags for more than a couple lines of code. (by smilodon)
Function that prints only records containing B or b?
 
Hey guys, I have a sample review test I am working on for an exam tomorrow, and came across a question that I am unsure on how to implement. It is aski...
[5 replies] Last: Okay sounds like this is what it should be. void patient_info::Pri... (by PinkInk)
Why does this not find the palindrome I'm looking for?
 
Hi, So I have been trying to find the the largest palindrome possible from the product of 2 three digit numbers. I have tried the following: #include ...
[1 reply] : The goto here is not necessary and should be avoided. (In general avo... (by smilodon)
return code
 
what is the return code or syntax for starting the program over. my problem is when the end of the program comes up , i want to give the user the chance to sta...
[1 reply] : while http://www.cplusplus.com/doc/tutorial/control/#loops... (by Bazzy)
by Sperry
Some linker errors I don't understand
 
I have recieved some linker errors in my program: 1>Main.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cd...
[8 replies] Last: Quotes work, as well. (by helios)
cmd prompt disappears
 
I'm using Dev-C++ on XP. The last three programs went fine, but now the cmd prompt disappears before I can read the output. I'm using system("PAUSE"); but it no...
[4 replies] Last: Refrain from using system() commands. Stick with cin.get(); (by Kangaroux)
please solve this problem and make the program
 
Problem Statement: Multiplication of two objects of same class • You are required to write a class. Class should have an array of 10 integers as its priva...
[14 replies] Last: lol ... perhaps later, because I didn't keep the original implementati... (by jsmith)
somebody can answer this problem?
 
construct a time class containing integer data members seconds,minutes,and hours.have the class contain two constructors:the first should be a default construct...
[15 replies] Last: ajmal1122, please start your own thread and post your code with neat f... (by kempofighter)
how i can make socket connection using C++
 
Greetings all, am new with C++ coding and i was wondring if i can make a socket connection between server and client using C++ and its connected to database ...
[6 replies] Last: No problem :) (by Seraphimsan)
Populating 2x2 Vector
 
Hey all, I'm reaidng in values from a CSV value and am storing them in a 2x2 vector that is being dynamically allocated. My CSV file has 12,649 rows, but...
[4 replies] Last: Galik, you're completely correct. However, due to the output I was get... (by Zero One)
by pdgui
Understand the low-level in the following code:
 
Hi, I'm Learning C++ and I make this exercise: // factorial calculator #include <iostream> using namespace std; long number; char r; long facto...
[6 replies] Last: But in a large code (that I still have not learned how to do), this ... (by Duthomhas)
July 2010 Pages: 1... 1516171819... 31
  Archived months: [jun2010] [aug2010]

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