Beginners - February 2010 (Page 29)

looking for numbers
 
hi,i'm new to c++ and i'm try to practise some stuff i've covered while learning. the goal for the code is for the use to enter a few numbers, then enter a num...
[5 replies] Last: You can't cin>> into an array and have it be populated with the digits... (by Zhuge)
by peaco
Private data in classes
 
I have the following header: #ifndef PLAYER_H #define PLAYER_H #include<iostream> #include<cmath> #include<string> class TicTacToe; class Play...
[2 replies] Last: Thanks, knew it was something simple. (by peaco)
using both int and char types for cases in one switch statement
 
Hi all, I'm new (to both the forum and the language), and I'm at an impasse with an assignment. I wonder if someone would point me in the right direction. I'...
[3 replies] Last: That did it! Many thanks to you, Disch! It's so easy to lose perspecti... (by arboria)
Run program in pieces
 
Hi, I try to do the following: int main () { int numobs //number of observations // statement a<numobs<b, then c<numobs<d -> a<b<c<d funct(); ret...
[4 replies] Last: http://cplusplus.com/doc/tutorial/files/ using the string class http:... (by gcampton)
by cppbeg
short function
 
czxcccscsdD
[12 replies] Last: This is shorter - but is it any less 'readable' ? void menu_display(... (by guestgulkan)
by Wylbur
Input Redirection for Windows Command Line Apps
 
Hi all; I am renovating an old DOS app to run under Windows. At one point, input redirection is being facilitated with DOS interrupt 0x21. Service 0x0b...
[3 replies] Last: I was going to post the following (but had to go pick up my wife and k... (by Duthomhas)
NASCAR problem
 
I'm entering a programming competitions, and this is one of the practice problems: Problem #10 NASCAR’s Nextel Cup Winner NASCAR official...
[no replies]
Pointers in functions
 
void display(const vector<string> & vec); //prototype int main() { vector<string> inventory; inventory.push_back("Obj1"); inventory.push_back("Ob...
[1 reply] : This has nothing really to do with pointers. Here, the & operator i... (by Disch)
opinion on continue and break statements
 
my programming teacher says continue and break statements aren't good to use. but i have always used them. what are your guys opinion on the use of the break an...
[5 replies] Last: Doesn't your teacher ever use the 'switch' structure? You usually nee... (by cnoeval)
by H P
g++ -m32
 
Hello, I am trying to create a 32 bit executable on my 64 bit linux machine. I have the following makefile: OBJS = Subtract.o CC = g++ DEBUG = -g C...
[3 replies] Last: Thank you. After searching a bit, I required to install libstdc++4... (by H P)
Problem with selection sort
 
Hi, I was trying to do insertion sort for the array data ={3,1,4,7,5}. But always '7' comes as the first element and the rest of it is sorted correctly. the pr...
[5 replies] Last: #include<iostream> #include<cctype> using namespace std; void Se... (by Maimaje Bello Abdullahi)
Wordwrap function
 
I saw this online: std::string wordWrap(std::string sentence, int width=55) { //this iterator is used to optimize code; could use array indice //iterates...
[2 replies] Last: std::string wordWrap( std::string str, size_t width = 55 ) { s... (by jsmith)
by dmpm
Mean, Median, Mode
 
I have been given some source code by a friend for a program that calculates the mean, median and the mode. I want to make the program read from a txt file inst...
[5 replies] Last: bazzy +1 , also you should get rid of the scope on lines 11 and 51 unl... (by gcampton)
input problem
 
hi guys, what code do I need to use to check if a integer variable got the right value when someone input a value using scanf or cin? #include <iostream.h> ...
[1 reply] : http://www.cplusplus.com/forum/articles/6046/ (by Bazzy)
by ppolcz
disable a variable?
 
Hello all! How can I disable a variable, or change it's type; eg: //... int variable //using it //disable it char variable //using it as a charecter ...
[1 reply] : scope: //... { int variable //using it } //disable ... (by Bazzy)
by ppolcz
object as parameter
 
Hello! I want to make a list of classes! How can I do it? I tried in this way: class Pont { //.. }*firs, *last; void putin (Pont tmp) { last->next...
[1 reply] : void putin (Pont tmp) { last->next = new Pont; *last->next = tm... (by Bazzy)
Problem on assigning values to a structure
 
following Code segment gives me segmentation fault. Any explanations pls #include <stdlib.h> #include <iostream> typedef struct test{ int value; ...
[1 reply] : because t is a pointer to a struct test and you do not initialise ... (by closed account z05DSL3A)
by nancee
String concatenation
 
Hi, I want to create an C++ program for " String concatenation using dynamic memory allocation concept" . Please any one send me a sample code for this. ...
[4 replies] Last: I'm assuming you have been learning about arrays in the last week, or ... (by gcampton)
c++ and assembly: undefined reference to
 
Hi! I'm writing a little equation solver for an exam ... it has not to be perfect or mathematically rigorous. With this program I have only to show to my profe...
[5 replies] Last: I added this line to class_razionali_debug.cpp extern "C" int rad (... (by gianx80)
I want to design a programe that can search for a information in text file.
 
Hello as you can see am very new in this site, this is my first post... can somebody please help me out here. i want to design a program that can search for a f...
[12 replies] Last: thanks to you all. (by jobarteh88)
February 2010 Pages: 1... 272829303132
  Archived months: [jan2010] [mar2010]

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