Beginners - February 2009 (Page 14)

How do I avoid a string being inputted for an int?
 
#include <iostream> using namespace std; int main() { string saying="You want some random numbers generated? How many?"; int input; while(1){ ...
[3 replies] Last: It is defined on line 24. (by jsmith)
Accuracy of float and double
 
I have a program that takes in a cash amount in dollars and converts it to coins. Whenever the amount of pennies is over 1 the program output says that one less...
[7 replies] Last: Article: Rounding Algorithms http://www.cplusplus.com/forum/article... (by Duthomhas)
by Morgan
Having a little trouble with cin.ignore.
 
Hello, I'm having a little bit of trouble, You see i can't figure out why in the following bit of code : void quit() { cin.ignore("/n"); cin.get()...
[2 replies] Last: Thank you very much. (by Morgan)
The result doesn't show...
 
Ok, Hi, thanks for reading my code. Ok this Function its suppose to calculate the power by 2 or the square root of a value, depending of the entry code. As you...
[2 replies] Last: Your method calculo() is not outputting the data, just returning it. ... (by Zhuge)
by turke
Detecting string chars?? (1,2)
 
I made something like this: if (a=="1") Attack(); else if (a=="2") Block(); else if (a=="3") Cast(); else // <<<<<<<<<...
[23 replies] Last: Tnx m8 ^^ (by turke)
by dhungj
How to read a file using getline?
 
Can you please help me to read a file and pass it through getNextLex? I havw an example below this program which shows what i am trying to do. #include <c...
[1 reply] : infile.open(filename.c_str()); // open file if(infile) { string... (by Zaita)
by memoc3
plz, urgent.. how to assign string from data
 
Helo..here i want to read data from a text file arranged in single column like: dog cow crocodile monkey -and assign it to a string called 'string prod...
[9 replies] Last: Post your complete code again. (by Zaita)
DLL -file and lib-file
 
Hello, I do not now how I must load a library file in to my project with Visual C++. I need it to use an USB-module : To use the Universal Library with M...
[no replies]
by Sain
I need to make a table but dont know how..
 
NOTICE: I already solved the equation part of it and i just need some advice on making a table, I'm completely lost and just need some guidance. I've been re...
[1 reply] : http://www.cplusplus.com/forum/articles/6046/ (by Zaita)
by masiht
what is void
 
I have a question why do we use such a big program like // void function example #include <iostream> using namespace std; void printmessage () { co...
[3 replies] Last: It means that the function doesn't have to return a value eg: i... (by Bazzy)
by memoc3
finally i write a spelling checker program using c++ string..but cant compile
 
finally i write a spelling checker program using c++ string..but cant compile.. actualy i got 30 errors but i manage to reduce it until 8. But then i cant figu...
[2 replies] Last: memoc3, please use code tags to post code, telling us what the errors ... (by closed account z05DSL3A)
by hannad
getline(cin,str) problem
 
Hello, I wrote this code and I keep getting a problem in it. #include <iostream> #include <fstream> #include <string> #include <windows.h> using namesp...
[9 replies] Last: I am using Microsoft Visual C++ 6.0. My code gives me the following: ... (by hannad)
Getting Array data into a Function
 
Heyo - I'm still pretty new at programming and I've been trying to figure out what I'm doing wrong in calling the low_highScores() function below. Is the prob...
[4 replies] Last: Butterkeks - Thanks. That was it. (by Gwindarr)
by diva
how to sort the value stored in pair
 
I would like to sort the value that stored in a pair, in descending order(from highest to the lowest). The pair I have defined looks like : pair<string, doub...
[5 replies] Last: I take it you have quite a few pairs. Are they being held in an array... (by kbw)
by jaised
virtual and dynamic? Superclass to Subclass
 
Ok, I will do my best to explain my situation. I have tried looking online to try to make this work and have yet to find anything so I hope you can help me out....
[2 replies] Last: You could add a virtual print method to the base class, and overload i... (by seymore15074)
by ozan
Matrix Library
 
Hi, I am using Windows Vista as operating system and Microsoft Visual C++ 2008 Express Edition as an compiler. I need a matrix library.Could you suggest me...
[2 replies] Last: Thanks Zaita, But UBLAS has no function that takes square root of th... (by ozan)
declaration problems
 
Im trying to make a program that figures out the smallest of 3 numbers entered by the user and cant get it to work. here is my program: --------------------...
[2 replies] Last: firedraco seems to have missed that you're not actually assigning the ... (by helios)
by rain
I have problems with dll file
 
Hello I would need some help with dll files I am trying to make dll file that display two msgbox and then create console window. I made my project with code...
[5 replies] Last: WinMain() doesn't create a command window. It's a GUI orientated entry... (by Zaita)
declaring string param in function problem
 
I thought I knew a little about functions, but this obviously proves otherwise. I have a function that compares two strings and if they are the first is le...
[2 replies] Last: ugh, though I did have those headers I had forgotten to put a final } ... (by mariokartlegendd)
Exporting Inputed info to External File
 
Is there anything wrong with my code that would prevent this info from being put on an external .txt file. Any suggestions would be well appreciated. /******...
[3 replies] Last: replace endl with the value you want to write to the file (by Bazzy)
February 2009 Pages: 1... 1213141516... 22
  Archived months: [jan2009] [mar2009]

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