Beginners - March 2012 (Page 47)

by HankP
Read in from a text file
 
Hello! I have a textfile with ID numbers and text. The ID-numbers is exclusively on its on row, with text under it. Example: 1098290-7 here is text I ...
[1 reply] : This: if (row == "1098290-7") will not behave as you would expect. ... (by long double main)
ceaser cypher
 
hey so i need to make a ceased cypher program where you input the coded message and output the cyphered version. i have this code and it compiles with no issues...
[2 replies] Last: What is argv[-3] ? What is a segmentation fault, Alex.... (by IceThatJaw)
problem with while loop
 
Hi, I'm really new to c++. This code is compiling but after the while loop in ask(), the screen starts flooding up and scrolling down, i dont know whats causing...
[2 replies] Last: Your ask function claims to return an int , but it doesn't. You are ... (by Moschops)
by HankP
Comma Separated Values
 
Hello! How do I save information comma separated, when I write from a C++ to a text file? If the program read in information about a person, ex name and s...
[2 replies] Last: Thanks a lot, Stewbond! Now it's working fine! (by HankP)
vector<> adding new row?
 
I have a vector with 1x4 1: row size 4: coloumn size How can I make it 2x4 dynamically? then 3x4 then 4x4...
[12 replies] Last: You should select either you use std::vector or you use dynamically al... (by vlad from moscow)
Problem with inheritance and constructors
 
Probably a really stupid mistake, but anyway. Here's code from a header file where I declare two classes: class creature { public: int x, y; int hp...
[2 replies] Last: Thanks, it works now :) (by Lunaritian)
creating something like "ostream"
 
Hi all, Long story short, in school we've made functions with prototypes such as: void printData(ostream& object = cout); The purpose is to print something...
[no replies]
by myoni
problem with class
 
I don't understand why the constrctors are defined by program and other functions not. this is the code: heade file: #ifndef RationalNums_H #define Rational...
[1 reply] : int get_numerator() // <- defines a global function named get_numer... (by Disch)
Reverse Numbers help
 
I am trying to use a function to reverse numbers (ex: 123 to 321, -0065 to -56), I am having problems trying to convert numbers such as 7008 to 8007, anyone hav...
[7 replies] Last: OK NEVERMIND GUYS!!! lol My brain got divine intervention and I figure... (by Joseph Fiddler)
Linking errors
 
Hi all, This code cannot compile because of the following errors: main.cpp|12|undefined reference to `Scheme::Scheme(std::string, short, short, short)' m...
[5 replies] Last: Thanks! that fix solved the error. (by david188288)
Need Help with "Game"
 
I need to create a game where the objective is to take "Points" out of a pot and the winner ends up being the person who gets the points down to 1. I can't cre...
[1 reply] : Bump, I really need help with this guys. I can't seem to get the RNG... (by edwinshap)
'{' Error! Please Help!
 
Dear Members, I have recently started learning C++ on my own. I have learned fast and have improved my skills. Today I decided to make a simple calculator but h...
[2 replies] Last: Your code above compiles, but I couldn't help noticing a major flaw. ... (by Stewbond)
by ctest
Few noob c++ questions
 
1. the question is when the "yes" will be printed int department ; cin>>department ; if (department == 1 || 2) cout<<"yes"<<endl ; How I understand th...
[11 replies] Last: First we do the suffix++ The ++ prefix and the addition have the same... (by cire)
VBA to C++
 
Hello, I recently did programming at school and what I thought was C was actually VBA. I tried to change the VBA to C++ but I couldn't does anybody know how to ...
[1 reply] : int counter; int num; int tot = 0; for (counter = 0; counter <=... (by HankP)
by HankP
Write text to a file
 
Hello! I´m kind of a noob when it comes to c++. Right now I have a project where I'm going to write text to a file; socical security number (text?) and name...
[5 replies] Last: The problem now is that namn, teleNr and svar are all chars. This me... (by Stewbond)
C++ code is not working would someone please help me understand?
 
This is what I have and it is not working properly. #include <iostream> #include <iomanip> using namespace std; int main() { //declare variable...
[3 replies] Last: cout<<"Year: "<< year<<"Raise:$ "<<raise<<endl; (by Eyad)
Adding a comment
 
Can someone help? Please check this code. After the do while loop, I want to put a comment. how can this be done? What I have here does not work. -----...
[3 replies] Last: Ah ha, I see your problem now: You can't put {} inside of a while lo... (by Stewbond)
by dk3919
Strange error I have never seen
 
I'm getting the error: " terminate called after throwing an instance of 'std::length_error' what(): basic_string::_S_create Abort (core dumped) " As of...
[2 replies] Last: Realized I was testing way too soon and had not even finished the func... (by dk3919)
need help with class object arrays and member functions
 
my latest assignment in my intro class is to write a program that uses a class to create an array of class objects, displays the array contents and give a menu ...
[1 reply] : to continue... here's my main and the output.. #include <iostream> ... (by C Theroux)
by Lio
Operator overload member or non member
 
Hi,I am studing operator overloading right now ,is there any rule if the operator overload should be member or non member of the class Thanks
[2 replies] Last: These are effectively equivalent: class MyClass { public: MyClas... (by Stewbond)
March 2012 Pages: 1... 4546474849... 71
  Archived months: [feb2012] [apr2012]

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