Beginners - July 2011 (Page 44)

by wtf
How can I override the assignment operator for my class to allow for the assignment as 0 (or NULL)?
 
so i can do something like: class myclass{//yadayadayada}myinstanceofmyclass; myinstanceofmyclass = 0; I'm getting error message. this is what ...
[5 replies] Last: thanks I got the idea now. (by wtf)
while loop does not work
 
Ok, so I have the basics of a program that has a while loop. Here is the code: // Fortune Teller #include <iostream> #include <cstring> #include <string>...
[5 replies] Last: Dapasta! You know that "-----" is use to print any thing on screen and... (by Waqas786)
Some help with for loop
 
I couldn't find out about this anywhere, and couldn't practically check it, so I am asking it here. In this for loop: for (int i = 0;i<20;++i) which, wil...
[3 replies] Last: Nisheeth!I think you know that loop executes until the condtions remai... (by Waqas786)
Opening any file extention
 
I have been looking for a answer for a while now but cant find anything. can i make a c++ program be able to open up any file extension. or how would you do ...
[1 reply] : open means what? open a stream for reading or open as in open mp3 and... (by writetonsharma)
What is a header file?
 
What is a header file and how do I write one?
[1 reply] : Header file is a text file. The text is C++ code, of course. Technical... (by hamsterman)
Sorting List
 
Hey everyone, I've created two linked lists that hold a name and a GPA (both lists hold the same data) and I need to sort them according to GPA. I'm having tro...
[8 replies] Last: Thanks for the reply fun. Yes I've changed my entire code to use NULL... (by ecstasyaeternus)
by codrgi
finding length of string/int?
 
how can i compare a values length and if it's a certain length, then return, for example how do i do something below in c++? int number = 15; if (length_fu...
[1 reply] : If by "count the length" you mean find out the number of digits a numb... (by webJose)
by eidge
Pointer to 2D Arrays
 
Here's my falty code: char **scl; scl=new[some int][another int]; This is obviosly wrong, because C::B spits this out: o\Cpp\scales\scales.cpp||In con...
[7 replies] Last: When I said "something like this" I gave a bad example as a note can b... (by eidge)
why warning: not all control paths return a value?
 
If someone can help point me in the right direction, it would a big help. I have spent hours staring at this and everything seems ok to me. I am having some di...
[4 replies] Last: I made those changes and ran it again then got this crazy error that s... (by rastroh)
storing input
 
How do I store console input for later use? I want the user to pick a letter from a list given i.e choose a,b or c. How do I get this input stored? I want to be...
[8 replies] Last: that worked! Alas, it was such a simple solution....I will mark this p... (by xXmusicmanXx)
Question on Best Practice regarding set and get method in class composition...
 
Hi, I’ve got a philosophical question about the set and get methods of classes. I will try to make it clear… Let say we have typical user class called «...
[8 replies] Last: What is the best practice to modify the value variable of a classC ob... (by ne555)
Making Choices RPG
 
Heya, guys. Once again, I'm in need of help. I've been thinking, and thinking, and thinking of a solution to this problem, and here it is: I want to create...
[5 replies] Last: I haven't got much experience, but I can learn about it. I'll definit... (by RialnisMada)
by Sektor
Problems with pointers
 
Hello, i'm new here and also at programming in general, i been selfstudying C++ for about 2 hours now this language since i found it very easy to understand, le...
[2 replies] Last: Oh, thank you for helping me, after to read your comments i double che... (by Sektor)
Overloading Operators
 
If I Overload the + operator in a Class A. Now can I use the operator for regular addition?
[7 replies] Last: Thanks for all the help! (by Nisheeth)
sorting vector storing TIME
 
Hello all Could any one please tell me how do I sort a vector of type struct storing "time" (besides few other variables) e-g 13:00:28.91, 12:58:24.81, ...
[4 replies] Last: Thanks Athar :) (by vbaswant)
Verifying Integer Input with a function call
 
I'm trying to verify that the user has input an integer. I found a great post on this on this site (http://cplusplus.com/forum/articles/6046) - Thanks Zaita! ...
[4 replies] Last: I did modify Zaita's code. Just skip over the advanced bits and look ... (by wtf)
by tonnot
I need global access to some variables, how ?
 
I have the main classA, it creates instances of class B, this in turn creates instances of class C, Imagine my class C ask for a value that I have to pass up...
[5 replies] Last: Another option is to create a "singleton" object. That is, throughout ... (by Moschops)
what is _NO_PROTO
 
I saw in many software's utility files ..something called #ifndef _NO_PROTO ..can some one explain me ..what is it ??
[2 replies] Last: thanx moschops ... (by spra1323)
by jontyl
Buffer Overrun in simple program
 
Hi, I'm working through a series of C++ mini exercises, and one was the addition of a 2x3 matrix Here is my code: //=========================================...
[5 replies] Last: Your compiler should have generated a lot of warnings like: warning: ... (by Athar)
by Rox
Iterate over a list of objects
 
I have declared a list like this: list<Animal*> animals; I have then filled the list with some animals (classes that are derived from Animal, like Dog, Ca...
[8 replies] Last: Sorry, forgot to mention in my previous post that I solved it by decla... (by Rox)
July 2011 Pages: 1... 4243444546... 54
  Archived months: [jun2011] [aug2011]

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