Beginners - May 2014 (Page 26)

Building Class and Saving Class using Fstream
 
Hello! My problem today involves reading and saving a class object from/to a file (file name provided by user). I have the program reading and writing to the fi...
[4 replies] Last: I fixed my problem x_x It was all caused by an issue with a class con... (by Parasin)
by Relit
Edit. Compiler errors. Code Blocks
 
For some strange unknown reason i get an error in my codeblocks when trying to run this. it's in my coins.cpp it give me a fatal error coins.h no such file or d...
[5 replies] Last: Have you created a console project, sounds like you may have created ... (by Codermik)
Cin issues?
 
So whatever reason whenever I ask the user for the job name the loop skips over the cin statement. #include <iostream> using namespace std; int main...
[4 replies] Last: good answer MiiNiPaa, I didn't know that! (by Parasin)
by mrju5t
how to find spaces in between characters in string?
 
I'm writing a program that returns true if and only if the input are numbers and contain one decimal, e.i. (8.3). Also it cannot contain space in between the nu...
[4 replies] Last: Just saying. Your brackets are a nightmare to look at. Having said tha... (by Parasin)
program not reading from file properly
 
my read in function is load_plans and is on line 132 #include <iostream> #include <cctype> #include <cstring> #include <fstream> using namespace st...
[3 replies] Last: On line 163 you have a random ++i; Not going to fix your problem most... (by Parasin)
by road
Checking mult choice test answers!
 
I can't get seem to get the syntax right non this. I am trying to check a correct answer array against an array of answers filled into the program by the user. ...
[1 reply] : Your for loop on line 23 is incorrect I believe. It's in your conditio... (by Parasin)
Error: Undefined reference to class
 
I've just begun learning C++ through TheNewBoston tutorials, and I cannot get passed this particular project because I can't identify the problem. It says,"und...
[3 replies] Last: Yes I was about to say scratch what I said, your code compiles fine fo... (by closed account L6b7X9L8)
how would you count objects of same name in OOD
 
I can provide code if needed. I have a linked list. With and object type of another class. It works. How would you count objects of the same name gener...
[2 replies] Last: I am asking about objects of the same type and same name. (sorry drink... (by Bdanielz)
How can i swap word
 
How can i swap word in C++ i don't know how to do it ? Input two character arrays Name1 and Name2 of the size 12. Print both arrays in reverse order as shown i...
[1 reply] : If you want to do it this way then I would suggest looking into the da... (by Hambone)
strings and failed passing
 
I'm trying to have classification return two strings but it is only giving me one. I know that i can return more than one at a time so i tried messing around ...
[5 replies] Last: Well it can go either way <type>& t or <type> &t and same with poi... (by BHX)
What is GNU GCC C++ Compiler
 
Can anybody explain why this would be needed and what it does?
[1 reply] : http://www.coronadoenterprises.com/tutorials/cpp/cpp_ans.html (by Lachlan Easton)
copy pasted array tutorial, got errors
 
Getting 31 errors like: -Invalid overload of 'find' -Symbol 'armor' could not be resolved #include <iostream> #include <string> using namespace st...
[1 reply] : These errors have to do with the fact that the string literals aren't ... (by xismn)
Printing string in reverse order
 
Hey guys I am new at c++ I was just wondering if someone could show me how to print a string in reverse order(for example: "today is Wednesday " to "Wednesday i...
[5 replies] Last: Pretty much, yeah. This would entail reading from a file, properly par... (by xismn)
Overwriting of a text file.
 
It is a function to overwrite the value of an account. Basically it creates a temporary file, copies all the accounts except the one which we are working on to ...
[3 replies] Last: See (1) for the problem with that. (by Duthomhas)
problem with for_each and lambda expressions
 
Hello, I'm learning STL and lambdas for the very latest version of C++. I was hoping that in the following program I would fill a vector with values 1 to 6 a...
[12 replies] Last: The C++11 mode is not enabled by default -- lambda expressions are e... (by Duthomhas)
Odd or Even counter in Array
 
Hey so this part of the code is supposed to calculate how many odd numbers and even there are in the array. I searched and finally wrote this piece of code but ...
[8 replies] Last: Your welcome :) (by Codermik)
class help/static variable problem
 
Write your question here. #include<iostream> #include<string> using namespace std; #ifndef TOY_H #define TOY_H class Toy { protected: stri...
[5 replies] Last: thank you! adding the" int Toy:: _count = 0;" worked! (by suhuhuhu)
ifstream empties file
 
For some reason the following program prints out No data?! Even when I have data in the file. It empties the file input.txt that has the data. Here is the main ...
[2 replies] Last: Oh, thank you that fixed it. And I thought my book was wrong for writi... (by closed account EwCjE3v7)
fstream read a line at a time
 
How would I convert the following function to read a line into each element in the vector instead of a word at a time vector<string> getfile() { std::i...
[3 replies] Last: Thank you guys, posted at the same time :). Thank you once again. (by closed account EwCjE3v7)
by Huppa
Extra parameter in call to function main
 
Hello, I am consistently getting the error, Extra parameter in call to LD() in function main() If you could help me find my error, so I may fix it, it would ...
[3 replies] Last: Yes. (by AbstractionAnon)
May 2014 Pages: 1... 2425262728... 55
  Archived months: [apr2014] [jun2014]

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