Beginners - June 2009 (Page 11)

inheritance and file I/O
 
is it ok if i pass a file name to base class constructor to open a text file and then perform operations on that file in the derived class object?
[1 reply] : Absolutely. As long as you can access the fstream object in the deri... (by Hammurabi)
Read Function Dilemma
 
I want to say for(i = 0; txt != ' '; i++) where txt is a char variable and i is an int variable. Is this legal or is there a more specific way to refer to...
[7 replies] Last: void read(char txtstr , int& size) { int n, i, x; char txt, t... (by vectorcpp)
register <var>
 
I've been working through my c++ book and its just introducd the register storage class specifier. It said that: Technically, register is only a request to ...
[8 replies] Last: Yes, yes, of course. All this is dependent on compiler options. How... (by Duthomhas)
by wretch
initializing class members with member constructor
 
#include <iostream> using namespace std; class myClass { public: myClass(int inVal) : myInt(inVal){} //this is legal //myClass(int inVal) { myInt...
[4 replies] Last: I'm unsure what you mean about "class known to myClass". The initiali... (by kempofighter)
Array problem
 
hi i am new in c++, my problem is pass a multi dimentional array to a function int hitemp (int temp ); //function diclaration int main() { int r...
[1 reply] : You have three errors: int hitemp (int temp ); //function diclarati... (by Bazzy)
my ever first C++ program.. I dont know whats wrong
 
i,m working with a "inventory" system here but it seems i cannot find whats wrong.. a help is greatly appreciated.. thanks! #include<iostream.h> #include<m...
[14 replies] Last: Well, tbh i think that it is hard to understand classes unless you alr... (by awasteoflife)
Oh man this is tuff!
 
I don't know were my error is. It's producing a "debug assertion failed" error. int length; int height; int L; int H; char r; string s; ...
[1 reply] : I think you're stepping out of bounds of your array: (line 23) ... (by Disch)
project error. >.<
 
Hello, I'm a SUPER n00bie at programming anyways i have this project. the programe is alomost complete i just have to add one more thing. its just tha...
[8 replies] Last: It seems someone needs to learn why functions are important. (by helios)
alphabetic sorting
 
hi everyone.I want to alphabetic sorting of this program.But it didn't working.why? thank you
[6 replies] Last: @duoas very very thank you.it's working xD.cool again thank you :).My... (by areyoupp)
reading from a text file
 
One question... I have a text file like: DATA1=0; What would be a way to look for "DATA1=" and return the value inmediately next...?
[5 replies] Last: I thought fd 's post was succinct and complete. Just looking at the ... (by Duthomhas)
Linking Images?
 
Hi, I'm starting to put some images on buttons in my program, and I'm wondering if there is a way to link them to the executable so that I don't have to use a p...
[2 replies] Last: On Windows, use application resource files. On Unix/Linux, you'll... (by Duthomhas)
Creating an object of user def. class in another user def. class
 
hi. could someone please tell me if it is a syntax error if i create an object of a Document class in a class ViewDoc's function-ViewDoc is friend of Document-,...
[1 reply] : That is OK, you can use classes in the same way you use basic types (by Bazzy)
Problem with the heap
 
The program compiles fine, it just gives me an error: Heap Corruption Detected. I appreciate any help.Thanks #include <iostream> using namespace std; clas...
[5 replies] Last: thanks.Everything is now ok. (by alex1985)
by murva
Overloading on templates
 
Hello, I am trying to overload == but I always get the error error C2679: binary '==' : no operator found which takes a right-hand operand of type 'Vector<T>'...
[9 replies] Last: Thanks, you really helped me, == operator is ok, I will start to work ... (by murva)
by cukrus
calling class functions by random?
 
Hi, this is my first post so I apologise if I'm doing something wrong. I got a problem calling a function in a class from lots of functions by generating a ra...
[8 replies] Last: yah, maby you'r right thnx 4 replies (by cukrus)
Arrays
 
Could you, in theory, pass two comma separated values to one element of an array?
[3 replies] Last: an array of strings? Why would you want to pass two values to one elem... (by mcleano)
by Gerald
Recommend a free compiler please?
 
Hi, I am a new member and new to C++. I would like to know which is the preferred compiler to use during the learning process. At the moment I am using Open Wa...
[9 replies] Last: Personally, I fill that MinGW is more convenient than VC++ in setup bu... (by closed account S6k9GNh0)
Using loops to generate arrays
 
Just a quick question - Im trying to form an algorithm that uses a loop to initialise individual, unrelated arrays. So for example (I know this probably isnt co...
[5 replies] Last: ah quality, sorted! cheers for the link bazzy :) (by shoot to thrill)
by unnati
case statements
 
Hi all i have an array of 8 elements and then i have to do a different operation on some of the elements right now i am doing something like this switch(a...
[2 replies] Last: thank u thank u :) :) (by unnati)
Quick question
 
is there a way to set a whole array to a value initially?
[12 replies] Last: I'm not sure how A for loop works, but ur right I did have my grid ups... (by fire child)
June 2009 Pages: 1... 910111213... 18
  Archived months: [may2009] [jul2009]

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