Beginners - December 2010 (Page 9)

concatenating confusion
 
I am a little confused as to how this works: cin.get(name, size).get(); I know what it does (gets the info from the user, and then gets rid of the newli...
[2 replies] Last: The best way I can explain the first part, partly because it's somethi... (by Computergeek01)
by MFA
what is wrong with my code?
 
...
[2 replies] Last: yup u r absolutely right the problem is with the precision however i f... (by MFA)
by MFA
Can u give me an idea on how to write this program
 
i have a homework to output the array below 0 0 0 2 0 0 0 0 0 2 4 6 0 0 0 2 4 6 8 10 0 2 4 6 8 10 12 14 Not...
[2 replies] Last: hhh nice solution. Thanx for the reply, yeah i think i got the idea... (by MFA)
Dynamic arrays ad use of 'new'
 
Hello, If in my program I am going to read a number n and will require an integer array with n elements, what is to stop using this piece of code rather ...
[8 replies] Last: Pointers have their uses for creating "links" between values or for ea... (by Albatross)
veriable scope of map datatype
 
i am making modification to an existing research application, and i am having trouble with map data type. what is the scope of map data type variables? are t...
[1 reply] : I don't understand. Could you post a code example? (by hamsterman)
by sylar
Linker Error in Program
 
The main file of my program mainfile.cpp. #include "classfile.h" #include "test1.h" int main() { test t0;// test class define in header file "class...
[1 reply] : You haven't said what the error is. You need to post it verbatum. ... (by kbw)
by Bianco
Trouble with a program on C
 
Two files FA and FB whose names are entered on the keyboard contain integers sorted in ascending order. Write a program that copies the contents of FA and FB, r...
[1 reply] : It looks good so far. You need to have seperate variables for the siz... (by kbw)
Empty the input buffer
 
How can I empty the input buffer? There is a function to do it?
[5 replies] Last: I'm sorry but I don't understand all your code. cin.ignore( numeric_... (by Overflowh)
by tonnot
Global instance vs. Singleton. Pros & cros ?
 
Hello everybody: Can anyone explain me (a link can be appreciated) de differences ? Which is the best, the fast to understand, etc. I want to create a cl...
[no replies]
by linoch
#include "ccc_time.h" doesn't work?
 
Hello, I was trying to program the current time and the time left for lunch, but it indicates that there was an error saying: error: ccc_time.h: No such file or...
[5 replies] Last: File > New > Empty File BTW, where did you get the code above from? (by Bazzy)
Adding numbers
 
I am trying to learn c++. One interesting program requires to accumulate a running total of numbers up to a user provided number. Here is the description of t...
[2 replies] Last: #include<iostream> using std::cout; using std::cin; using std::endl... (by sylar)
c++ problems with printing bubble, insertion, and selection sort program?
 
I have been working on a program that requires me to use bubble,insertion, and selection sort. My program runs without any compiler errors. I have printed out t...
[2 replies] Last: I check the insertion sort. I did not using function "insertItem", and... (by guevara)
Initialising a class within a loop
 
Hello everyone, I am working on a Draughts game and have got a Draught class. I will need 12 pieces for each player and wish to declare them quickly within a lo...
[no replies]
by Zyborg
Can my code be reduced? (I'm sure it can be)
 
I am trying to make a game where the game randomly chooses orcs that you fight. I want the game to have a rock/paper/scissors kind of gameplay. The choices wi...
[9 replies] Last: thanks JoR I understand rand() a little bit more now. (by Zyborg)
compiled ok but no execution
 
*sort 3 numbers from highest to lowest by functions*/ #include<stdio.h> void read(int & v1,int & v2, int & v3) { printf("enter first number\n"); sca...
[2 replies] Last: thanks a lot, i corrected it but it keeps giving error before getting ... (by pabloli150)
by wtf
What does this do?
 
I have some globals declared such as: char englishlist = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's'...
[3 replies] Last: Look at line 10. You're checking for a space as a mark for the end of... (by Disch)
Is one variable initialization better than the other?
 
I see that there are 2 different ways to initialize variables in C++: int owls = 101; // traditional C initialization int wrens(432); // alternative C++ ...
[3 replies] Last: With user defined types, a temporary object then copy construction fo... (by Disch)
average is correct but the sum is wrong. :)
 
I'm having a problem with my program. I'm able to input all 10 numbers in but when it out puts the sum I get the wrong answer but then when it outputs my averag...
[2 replies] Last: In case you still need the answer... Following main(), it looks lik... (by Maybevin)
by ckdur
Resizing pointers
 
Hello! i'm using this code for resizing pointers (i don't like to use realloc) int CAccReader::ResizeAttribs(int nNewSize) { if(nNewSize<0) return 0; ...
[3 replies] Last: "CString****" this is because I need to save data, and sub data, and ... (by ckdur)
by moe93
Continue statement not within a loop.
 
#include <iostream> using namespace std; int main() { int drinks; cout<<"Hello to the virtual Beverage Machine."<<endl; cout<<"Please c...
[4 replies] Last: Like I said, continue quits the current iteration of a loop, so if a c... (by quirkyusername)
December 2010 Pages: 1... 7891011... 35
  Archived months: [nov2010] [jan2011]

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