Beginners - November 2010 (Page 11)

Trouble with Extraction
 
I'm working on a project and I have to extract each word of a line that the operator just entered in the program. I'm not sure how to do that. Any help with be ...
[no replies]
virutal function in static library
 
Hi there, I have came across a problem to make a library with virtual function. I have example code listed below and if I compile this way it works: g++ m...
[1 reply] : write the function definition for the func function for the base cla... (by guestgulkan)
by clomer
arrays of structs
 
Hello, this is my first post so Ill say hi. Im a complete newbie with C++ and we are learning it at our local college Im trying to make an array of a stru...
[3 replies] Last: Thank you so much. Case closed (by clomer)
how to count an element within array
 
#include <cstdlib> #include <iostream> #include <string> #include <sstream> using namespace std; struct book { string title; string outhor; ...
[6 replies] Last: thanks btw, i read it , but dont get it, i dont even know what class i... (by korselbujang)
Problem with simple program
 
Hi, I want to make a program which inputs two integers N and d and outputs all integers between 1 and N, which are divisable by d! And i think i did it but t...
[3 replies] Last: Thanks a lot.Omg what stupid mistake (i=n,i==n).I didnt saw it.Thank u... (by Beginnerr)
add new element without loosing existing data
 
#include <cstdlib> #include <iostream> #include <string> #include <sstream> using namespace std; struct book { string title; int price;...
[2 replies] Last: thanks, ill find out.... (by korselbujang)
division wont work properly in calculator
 
hey... i'm back with my calculator. it works just fine until the division part. it can just divide numbers that get a hole number, like it cant calculate 3 / 2....
[3 replies] Last: shall i change everyone with float/double? (by matsern97)
Code Review
 
I've written this code for a hangman game. I think i started off well, but ended up overcomplicating it. I'd be really grateful if someone could tell me how to...
[1 reply] : Re: The use of goto See: http://www.stevemcconnell.com/ccgoto.... (by closed account z05DSL3A)
by KDeuce
get line
 
I am trying to get a line from a file using the getin command however I am having some errors. rooms.open("c:\\rooms\\rooms.txt",ios::in); rooms.getline(roo...
[1 reply] : I guess rooms is an istream then getline requires a buffer and a size ... (by coder777)
Passing an array to function and retrun a value
 
I have read a file to an array successfully. However, when I attempt to send "avg" to a cout statement it returns a zero. I have walked through the function u...
[7 replies] Last: I'm very new to C++; I thought when I returned avg in my function r... (by Joseph1975)
Vector<string> issues in release, not debug
 
Its hard to put a title on this issue, but I hope thats ok! I have the following code (Please forgive the messagebox's, I'm just tracing the failure): ve...
[5 replies] Last: It was trying to put data into the vector for a file stream that conta... (by dbridle)
console stopped working during input getline
 
I try to search the similar symptoms on the web and also forum regarding this matter. I wish to create system to input student info( i start with name first) 1...
[5 replies] Last: Thanks coder777 and Duoas for helping me out. =) really enjoy learnin... (by miaOnDeLine)
P2P Theory vs Practical
 
im a computer science grad, and have studied a module that briefly touched on P2P. let me say again, briefly . so, it's all about DHT, Chord, yada yada yada...
[no replies]
Vectors and Arrays
 
So far I have an array that says this: char *myarray=("hello") and a vector that says this: vector<string> myvector myvector.push_back("hello") how...
[2 replies] Last: Thank you coder. I didnt want to convert it, just compare the contents... (by chesterbloke)
Reciept Program
 
Hello, I've been lurking around the forums for a while, picking up random bits of knowledge for use in my Intro to C++ class. However, my teacher as...
[3 replies] Last: Well, first write the program ignoring the conditions. Then try to red... (by hamsterman)
file and arrays
 
I have the prototype int read_list(int numbers , string filename) and I have 2 .txt files with numbers in them that I'm trying to place in the array to ...
[3 replies] Last: to convert std::string to const char*, std::string has a member functi... (by hamsterman)
Creating Mutiple Nested Class Instances
 
I am wondering how to create multiple instances of a nested class within one instance of the outer class. Here is a simplified version of what I'm doing: ...
[2 replies] Last: Ah! that seems so obvious now. Thanks for the help! (by daedalic)
expected primary-expression before 'else'
 
i am trying to make a simpel calculator but it wont work, i have written the code. but on line 34 and 38 the error Message comes up; " expected primary-expressi...
[4 replies] Last: @matsern97 It does not matter. good luck. (by firix)
by firix
How do I create an object of type complex?
 
Hi, How do I create an object of type complex but, in the main I do not want the creation of an object "Imaginary type" #pragma once #ifndef _IMAGI...
[12 replies] Last: @fun2code I could not understand what you say. the above code do... (by firix)
Problem with Inputting File Name
 
char filename ; int i=0; int j; char Read ; ifstream file; ...
[4 replies] Last: Don't check for eof. while(file >> y) is already doing that (when it... (by ne555)
November 2010 Pages: 1... 910111213... 42
  Archived months: [oct2010] [dec2010]

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