General C++ Programming - March 2013

Question about File Reader Class
 
I am making a file reader class to read files. It must be able to ,given a string skip ahead to the line after the given string. I am trying to do this in the c...
[1 reply] : Just realised its not when it tries to open the file it causes the err... (by martianxx)
Can you optimize this code/algorithm even furthur?
 
Well, this is part of an assignment where we have to work upon a problem and create a C program as a solution. The problem this: There is a bunch of guys standi...
[9 replies] Last: > The idea is that if I am taller than a person standing further to me... (by ne555)
Classes and arrays
 
Hey, I've been given a question which requires me to make a class and make use of it. They haven't given much detail so was hoping someone could please help. ...
[3 replies] Last: How would I make my class Module represent a single module? Would I ha... (by nobodyza)
LinkedList-
 
'LinkedList::removeFirst' : not all control paths return a value what does this error means? below is my code #ifndef LINKEDLIST_H #define LINKEDLIST_H ...
[1 reply] : The function should return an integer value in all cases. Yours return... (by closed account D80DSL3A)
by Yom
declaring and accessing arrays in classes
 
Any help here would be most appreciated. We are learning how to use composition. In this project there is the Main (), resistor .cpp and .h, capacitor .cpp ...
[9 replies] Last: In the default constructor, you don't initialize or set the values of ... (by cire)
by xAPMx
Problem with sentinel...
 
Hi everyone :) I'm trying to make a program but I'm having a hard time getting the sentinel right. The programs runs without the sentinel just fine, but I ne...
[3 replies] Last: O_O I completely forgot about that, thank you, both. (by xAPMx)
by Haze
Bubble Sort Random Array
 
Hi, I am new here and im looking for some help. I am trying to create an array with 800 element that are randomly arranged within the array. Once this is comple...
[2 replies] Last: thanks a million Yanson! (by Haze)
How to link static library C::B
 
Hello everyone, I have headaches for 3 days already figuring out how to create standalone program. For now I have simple program connecting to MySql Database an...
[1 reply] : Add already compiled as static library "libmysql.a" to linker input. (by modoran)
I swear my compiler is just trying to piss me off
 
So I finally gave in and headed back to Visual Studio's 2012 and this is what it gives me as a welcome home present. 1> TileEngine.cpp 1>c:\users\brandon\doc...
[2 replies] Last: Nope that was there, but I have managed to get it fixed. Just did a fu... (by closed account 3qX21hU5)
Calling derived class's functions in a function with parameter of base class
 
Say I have 3 classes: class Player { public: virtual func1(); }; class Human: public Player { public: func1(); //implemen...
[6 replies] Last: #include <iostream> int main() { class Player { public: virtua... (by vlad from moscow)
by vkt420
Need Help With Code About Structures
 
Hey, I'm having some trouble with my code. I had to rewrite my original code using structures. I've changed some things but it will not run after inputing the f...
[3 replies] Last: char is a name implied is a single character. You can use: a) char*... (by MiiNiPaa)
linked lists
 
hey guys ! i have a problem relating to linked lists .. Make a class called Card. Each card is represented by a suit and a rank. You can keep both as strings....
[no replies]
Question about singleton classes and when to use them.
 
Hi, I'm in the first year of a programming degree and although we are due to cover this area after the Easter break I am interested in perhaps implementing a si...
[no replies]
by ASCE
Easy way to Tokenize a file
 
Input file int a; int b; a=2; b=4; print a; Here is my code #include <iostream> #include <string> #include <fstream> using namespace std;...
[no replies]
by Elidor
Learning to read GNU code?
 
Currently I know C++ and am learning the discrepancies of C to C++. I've always wanted to understand C and C++ headers files at least a bit more. How can I go a...
[1 reply] : The actual GNU math.h pow function is not in the header at all, it is ... (by Cubbi)
Sorting Problem
 
I got a project that is suppose to take in info about an employee from both a file and user input then print that data in an organized format.(ex: from 1-n or n...
[4 replies] Last: Thank you, this info will be very helpful =D (by crimsonzero2)
by cnoobs
Employee class help
 
The person header. #ifndef PERSON_H #define PERSON_H #include <string> class Person { public: Person(); Person(std::string pname, int page)...
[3 replies] Last: First one should work, second one shouldn't. Reason: The first constr... (by Elidor)
Printing prime numbers
 
/* Task: create a function that determines prime number and use it to print out prime numbers from 0-50: */ EDIT task: Function prototype: Should return a `boo...
[3 replies] Last: wait i missed something in the task.. editing it now (by incognitocpp)
Hardware access
 
I found a couple of stuff about this on google, and most of it said that using the addresses is the easiest way. So, I was wondering how am I supposed to know t...
[1 reply] : You can't do it with normal programs, the OS runs them in a virtual en... (by LB)
overloading output operator
 
Hey guys. I've been hunting around the forums and tutorials, but I can't seem to understand the error I'm getting. I'm trying to overload operator<< , but I ge...
[1 reply] : std::ostream (by LB)
March 2013 Pages: 123... 51
  Archived months: [feb2013] [apr2013]

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