Beginners - November 2011 (Page 17)

assignment constructor for const member
 
Hi all, is there a good way to define a assignment constructor for const members? Below code doesnot compile for function Foo& operator=(const Foo &f), #i...
[3 replies] Last: Thanks for your replies. It's helpful! (by csxpeng)
how am i getting the user to prompt something with out using the set parameter
 
the retailItem class stores the data about a product sold by the store. It has an item description, item number and the retail price The retailitem class sho...
[3 replies] Last: class retailitem { private: double RP // variable for retail price ... (by Peter87)
how to prevent display the"The sum of all the digits is " when i input the value 0 .
 
#include <iostream> using namespace std; int main() { int num, x, sum=0; cout<<"Insert an integer between 0 and 1000: "; cin>>num; if(nu...
[6 replies] Last: "Insert an integer between 0 and 1000" (by B031110034)
by moot1
do while
 
where so i put the do while in this program so thet when i click y to restart it it allows me to choose how many numbers you want to use #include <iostream>...
[no replies]
Making own string class
 
Hello. I am creating a string class using primarily vectors and have created some functions to mimic some of the string functions. The following codes are my he...
[2 replies] Last: Thanks! I totally forgot about that. It fixed the problem. (by Swift1432)
invalid types `int[int]' for array subscript
 
Im getting an error " invalid types `int ' for array subscript " I've made the line bold. whats wrong with this code? #include<iostream> #include<fs...
[2 replies] Last: thank you! I knew It was a little mistake like that. (by Cosimo Vilardo)
creating a file with user defined file name and saving to it
 
hello there, im new to this site and ive been looking for ages to try and find a way of doing it, what i need to do is create a text file that the user will nam...
[4 replies] Last: woops my mistake aha sorry about that, so how can i go about changing ... (by spurgeom)
Pointers and Binary Tree Inorder Probelm
 
Yes this is a HW assignment. I will take any hints offered. \ I have implemented 2 binary trees. One using new.. I didn't use struct.. Just as a class. ...
[no replies]
How can I sort one array and keep another in sync?
 
I need to know how to write a simple linear(insertion) sort that sort's an array of #'s into descending order while maintaining the link up of another array of ...
[6 replies] Last: Yes, it is almost correct. Should be (lines 9-11): ... (by tfityo)
Preprocessor Directives
 
Hello all. I am wrapping up a tictactoe program and have run across a problem. I divided my program into three files.. the main .cpp file, a tictactoe class .h ...
[6 replies] Last: put the #include "gameBoard.h" after the using namespace std;. This sh... (by GBP)
change number to character
 
I'm beginner and i need help!! I dont know how to change number in character??? for example 4 --> **** or 6-->****** please help
[3 replies] Last: Ah, nice catch! I missed that. Peter87 +1 (by Duthomhas)
by mobat
2D Dynamic Array
 
solved
[3 replies] Last: bump. (by mobat)
by acorn
using new in constructor
 
I read on the net it was a bad idea to allocate new memory in the constructor or generally any initialization that can fail should be moved to its own function....
[3 replies] Last: ok i guess its true you dont believe everything you read on the intern... (by acorn)
by GBP
isDigit check allowing decimal point
 
So I am doing my isDigit check as follows but I want to accept a decimal point in the digit check. bool isint(char c ) { bool interr = 0; unsigned i = 1...
[2 replies] Last: LOL wow. Thanks! works fine now! :) (by GBP)
Need help with a data structure program
 
So I have to do this project for our C++ programming class but I'm having a few problems with it. I have it in the format that the teacher wants (for the mos...
[2 replies] Last: AH! I figured it was something stupidly simple. Thanks! (by Blargenth)
Confusion! I don't know what this means?
 
This program should give the AND of the inputted numbers. The above statement is what I have to do to this program among putting the program in order and get...
[5 replies] Last: The '&' is bitwise, which will return the address of a variable, N... (by Moschops)
Segmentation Fault with Switch Statements
 
I get segmentation when I run the program. Please help me figure out why. I've posted the two chunks of code that should include the problem. Thanks! Let me kno...
[1 reply] : You often get a Segmentation fault when you try to access memory you a... (by Peter87)
by neb11
Array of Structures Program
 
Hey. I have a program that is suppose to use an array of structures to create a computer database. If someone could help me get rid of my errors. Thanks. The...
[3 replies] Last: the third argument to getline should be a char, not a string. getlin... (by Peter87)
Need help how to output that a number is a whole number
 
the bottom line is really what I am needing help with I thought that I could use a wildcard to make the program recognize that any number with a decimal (.1 thr...
[6 replies] Last: Oh ok thanks moschops for describing that for me. (by agreenman20)
Code Blocks a matching debug configuration cannot be found wxWidgets
 
I have tried both downloading and installing the precompiled files but that did not work so I tried to compile them from the source myself. the page that shows...
[no replies]
November 2011 Pages: 1... 1516171819... 65
  Archived months: [oct2011] [dec2011]

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