Beginners - May 2010 (Page 28)

[Solved] opening file using a stringstream as path?
 
Hi all, I have a basic knowledge of C/C++ that has quickly failed me. In the program below (which is a piece of a larger one that I'm rewriting to C++ from ...
[5 replies] Last: Thanks again, I changed completely how I get user input so that it is ... (by acimmarusti)
Problem with inputing the char type
 
When i have two chars to input, the first char is exepted. Example: #include <iostream> #include <string> using namespace std; struct text { char...
[no replies]
Reading from txt file and putting into array
 
I am trying to read some data from txt file and put it into char array: char letter ; char c; ifstream infile("waldorf.txt"); if(infile.is_open()){ ...
[3 replies] Last: Thanks very much popasquat; but there is another rpoblem: what do I n... (by agajantorayev)
Problem with this file (1,2)
 
HI. I wrote these codes to add, search and delete student information. It works but with some problems: First of all this program shows some number (RAM numbers...
[22 replies] Last: If I understand correctly the problem is that when you delete an entry... (by m4ster r0shi)
by cyker
How to define mutual friend functions?
 
I know how to define mutual friend classes. But I really wonder how to apply that to functions. Since you have to let class A see the definition(not declaration...
[1 reply] : Functions can be friends of classes (is this what you want) Functio... (by guestgulkan)
by cyker
copy constructor not called during initialization
 
//Class.h #include <iostream> using namespace std; class Class { public: Class(int k) { cout << "cons" << endl; }; Class(const Class& c) ...
[1 reply] : After all, it should call cons first on 3 to create a temp object and... (by Disch)
problem with opertaions with numbers
 
im trying to find a way to add 2 numbers to gether . ANY way?? #include <iostream> using namespace std; int main () { double num1; double num2; c...
[4 replies] Last: Multiplying numbers is done the same way, using the * operator. Get... (by closed account Lv0f92yv)
by tidbit
Median function
 
#include <iostream> #include <iomanip> #include <fstream> #include <string> #include <vector> #include <stdio.h> #include <stdlib.h> #include <math.h>...
[1 reply] : http://en.wikipedia.org/wiki/Bubble_sort -Albatross (by Albatross)
I/O File streams in C++ HW...
 
I need to write a program that: Using a text editor (i.e. Notepad), create a text file called Text1.txt and place it into the root directory C:/. Fill Text1...
[4 replies] Last: http://www.cplusplus.com/doc/tutorial/files/ (by Duthomhas)
by navish
output file is overwrited
 
Hi everybody. This is my first post. For the customer function, i have tried to output to text file and data are overwrite each time i run the program. i have ...
[1 reply] : Open your file with the flags as std::ios::out | std::ios::app . Hop... (by Duthomhas)
user input from keyboard
 
Ok so I am making this super mega crapy game, far from Gears or halo, but you have to start somewhere. I am trying to get input from the player and then see wha...
[4 replies] Last: Thank you oghma that fixed it just right. I see now that the code was ... (by Kakashi)
by Gatt
Cant open my dev ++ project file
 
I saved a assignment that me and a friend have been working on for ages and there are 6 files in the folder. Assignment1.exe, Assignment1.layout, Assignment1.de...
[8 replies] Last: Main.cpp and the .dev file both have the exact same thing inside them ... (by Gatt)
Literals.. numeric character and string?
 
I have read about these, but I still can not get a grasp on what these are. Please help.
[3 replies] Last: I find that hard to believe. (by guestgulkan)
by ARWA
simple class and im confused>.<
 
hi am trying to construct a simple class put im verey confused i did this coad for now for me i dont see anything rong but for the compiler there must be an ...
[2 replies] Last: 1. If you the programmer provide a constructor that thakes parameters,... (by guestgulkan)
Mean and Standard Deviation to 100 numbers
 
Hello, Im a beginner at C++ and I have completely lost my mind to what my instructor is asking. The question is to create a program that finds the mean and ...
[5 replies] Last: What? There's nothing wrong with arrays. For an assignment asking ... (by Duthomhas)
by xeyide
Dynamic Array of Objects
 
I'm working with a simple object "Fraction." It holds a numerator and a denominator. I've also make a member function called .print() that simply prints the f...
[2 replies] Last: Ahhhh I see. I didn't even think about that. Thank you so much! A... (by xeyide)
2D Vector won't compile
 
Hello everyone, I'm having some difficulty with initializing my Vector. I'm trying to simulate a 2d array with vectors. The source looks good to me, but fo...
[4 replies] Last: Ahh okay, that makes perfect sense then. Thanks jsmith! I'm experi... (by chisser98)
by haim
Strings replace word in file
 
I need to write program that reads in string from input file and whenever it finds "foo" it should replace it with "xxx" and send corrected string to output fil...
[4 replies] Last: Your while condition is checking the state of the stream and it probab... (by moorecm)
Difficulty defining function pointer to DLL class member function
 
Hi, I have seen examples of using typedefs for function pointers, but I cannot get the following code to compile without "error C2440: 'type cast' : cannot conv...
[2 replies] Last: Sounds like I'm going to have to do some serious research into C++/C# ... (by mikecbjc)
convert exponential to decimal
 
I am struggling to convert an exponential number to the equivalent decimal value. ie. 2e2 to 200 or 12e-1 to 1.2 Any help would be much appreciated, even if j...
[2 replies] Last: You can read that as float or double in the first place and leave the ... (by Bazzy)
May 2010 Pages: 1... 2627282930... 33
  Archived months: [apr2010] [jun2010]

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