Beginners - February 2012 (Page 33)

How do I load a user defined file?
 
I am working on a project in C++ and the specifications are that I load a file specified by the user. In this file will be thousands of random words. How do I d...
[1 reply] : File locations are accepted as strings. Have the user enter a string t... (by ResidentBiscuit)
by Bnn678
A more effeicent way to get input from the user
 
Is there a more effective way of getting input from the user other than cout << "Do you want to buy a sword?" << endl; string sword; cin >> sword; if (swo...
[1 reply] : Input validation is fun stuff, and a huge part of programs that have a... (by ResidentBiscuit)
by eves
subtraction with vectors
 
Hi, I have a code for subtraction of a larger number to a smaller number. It works for most numbers but I've found error with 1: 100-(1 to 9) = 99 2. the prog...
[2 replies] Last: yep it's working now, thank you so much!!! (by eves)
classes, constructors, and user input
 
ok i posted a question last night and got a GREAT response that really cleared things up for me, so i thought i would try again... i know i should read through ...
[5 replies] Last: A stand-alone function, yes. And perhaps called from main, if that's ... (by cire)
Password Program
 
I am trying to create a simple password program in which the Password is already loaded into the program and the user enters a variable which The program will t...
[2 replies] Last: haha, easy fix total forgot that i have to use ==. (by davesjada44)
I need a project
 
Ok so, I've been programming for a bit now. I'm a CS major, and I'm to the point of trying to find internships or just a job in the field in general. I don't ha...
[5 replies] Last: It seems as if these mathematical problems would be better suited if I... (by ResidentBiscuit)
Replacing text in a file.
 
I'm having trouble editing text in a simple .txt file. My problem is that I don't know how to replace a string of text of a certain length without losing a cha...
[1 reply] : easiest way would be to use tmpnam() or tmpfile() to copy up to the in... (by useless)
Need help finishing hangman code
 
Here is my code: //hangman //Dylan Metz #include <iostream> #include <string> #include <fstream> #include <cstring> using namespace std; //functions //double...
[no replies]
my outfile is blank and I don't understand why
 
/* This program will calculate the current semester's GPA and the cumulative GPA of a student. The program should use an input data file to: read students 6 di...
[2 replies] Last: Thanks for the quick reply! You’re amazing. Worked like a charm. ... (by agent99s)
i have 5 source.txt in an 2D array i need to sort
 
my problem is that i use 2D array to store the information of each one of my source.txt so the first is use to store the number inside the txt and the second ...
[no replies]
Character pointers
 
Writing the strchr function using pointers. Can anyone tell me what I'm doing wrong here? char* pStrChr( char* str, int character ) { while( *str ) { ...
[11 replies] Last: through the compiler, it returns the balance of the string, not the p... (by cire)
Vector push_back() into multiple vectors
 
Here's my code when the user inputs a day of the week followed by int, it gets pushed back into that respected vector, but in my case it pushes back only to the...
[1 reply] : if(week_day=="mon"||week_day=="monday"||week_day=="Monday") Do the s... (by Peter87)
Is there a function that will allow me to store data?
 
I need help with making a function that will allow me to store things somewhere like an inventory system in a text-based game.
[2 replies] Last: you could possibly use a class object and a member function that creat... (by C Theroux)
by dk3919
Finding the largest number!
 
#include <iostream> /* max3.cpp -- program to print out the largest of three input values usage: ./max3 input: three doubles outpu...
[12 replies] Last: While we're on alternative solutions: inline double max2(double n1, ... (by cire)
Namespace and using print fuction
 
I'm new to using namespace, and im trying to print these values out with print but dont really know how to create the fuction print() to be able to print the va...
[4 replies] Last: Ok thank you guys i was just copying the code how the c++ book had it ... (by vega512)
External Class w/ namespace error
 
I have been trying to link files and headers with classes, but dev-cpp keeps throwing an error concerning lines in the namespace std I have three simple file...
[4 replies] Last: Thanks Jikax, that worked, I'll see if something similar's my problem ... (by surrealife1)
Unresovled external symbol
 
I am trying to learn C++, but i can't get this to work. From my understanding, it is conventional to put prototypes in a header file, and then have the implemen...
[6 replies] Last: Since your class is a template class, you can't separate your definiti... (by Lodger)
Recursive Reversal Function
 
I'm currently working on a code for taking in a character array, a , and it's length n. It's then supposed to reverse all of the letters and return them as a st...
[13 replies] Last: I did that just moments ago... The point is the stream cannot be reset... (by Jikax)
by KS05
What Am I Missing?
 
I have an area within my program that the user will need to input a list of words and once done use ctrl-z to end the list. I then want to take the list of word...
[5 replies] Last: none of you answered the actual question Ouch, aye. (by clanmjc)
Microsoft visual studio c++
 
I am new to MS VS IDE. So I created a project. In source file I added .cpp source file. Now, I know that I can't use two main file but can I have two source fil...
[3 replies] Last: Having more thane one source file is common for projects. Having comp... (by cire)
February 2012 Pages: 1... 3132333435... 64
  Archived months: [jan2012] [mar2012]

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