General C++ Programming - February 2013 (Page 36)

by EpiGen
Need help with finding error in class!
 
Hello everyone. I want to create my own List class. Problem is code compiles without errors, but in testing, reference to a specific element causes memory acces...
[1 reply] : Node(Node *aprev, const T& aelem, Node *anext): prev(aprev),elem(aele... (by doug4)
Dynamic Cast Template, anything is everything.
 
I store a vector of base class pointers, I'm trying to dynamic cast it to a derived class pointer, there are several derived classes, none of the classes have a...
[2 replies] Last: you're right, I could just check if its nullptr or not. right now I d... (by Zephilinox)
HELP! simple dictionary..cant search..
 
guyss need help for search....there is no content when i search word in the dictionary.txt....this is my example of dictionary.txt...in the add case it is worki...
[no replies]
Overloading Binary and Assignment Operators in Vector Class
 
Hi, I am making a vector class and am having some problems creating the overloaded arithmetic operators and assignment operators. Here is an example of my...
[5 replies] Last: Because I plan to use operators ( ) to access them later and just made... (by martianxx)
Shell sort won't work
 
#include <iostream> using namespace std; class CD { public: static const int num = 100; char publisher , title , location ; int year; public: vo...
[no replies]
Setting the background color and running a program
 
I use turbo c++ 3.0 Please tell me how to set the background color using the function setbkcolor() in graphics.h will i need to run the exe file in full s...
[4 replies] Last: well, what about this class user { int t; char ch ... public: us... (by closed account NwvkoG1T)
by cmc69
C++ data type question?
 
so i was just wondering.. Why when you do math calculations people sometimes do int, float or double? wouldnt it be best just to use float or double every time ...
[2 replies] Last: Thanks you.. This was just something I was pondering while writing a p... (by cmc69)
Someone know what is wrong with my program?
 
Hi so I made a program using if statements, but when I put 64 as the input it does include all of the correct input except the last part "Not divisible!" I real...
[4 replies] Last: joneele that was awesome and fast.. i just copied it to codeblocks and... (by cmc69)
How to define my own header file?
 
I have written code for a timer. with everything and i want to include this so i dont need to write or copy the reqd code each time. how do i do this?
[9 replies] Last: well , i defined t and then too it says t is not allowed. yea. i am th... (by closed account NwvkoG1T)
by CroCo
What is the benefit of destructor?
 
In c++ books, they usually don't elaborate about the hardware stuff. For example, the destructor invokes when the object is destroyed. What is the benefit of us...
[2 replies] Last: It's not just good practice. If you run any program which has a consta... (by BigBlackSheep)
trying to compare strings and having problems
 
Hi, I have an array of strings and I am trying to organize them in alphabetical order. It isn't working. Can someone please tell me if there is a way to do this...
[7 replies] Last: @LB It's under relational operators http://www.cplusplus.com/referenc... (by naraku9333)
why facing problem with this ??
 
In this code what is wrong ?? #include <iostream> using namespace std; class a { public : a(int i) { cout<<i<<endl; } } a(2);...
[3 replies] Last: Thanks a lot . Now it's clear to me. :) :) (by Shahriar)
read from a file, got an extra line
 
#include <iostream> #include <fstream> #include <vector> using namespace std; int main() { ifstream inFile; vector<int> arr; inFile.open("myFile.txt"); ...
[2 replies] Last: http://stackoverflow.com/questions/5605125/why-is-iostreameof-inside-a... (by cire)
Queue Using Double Link list
 
#include <iostream.h> #include <conio.h> struct mynode { int data; struct mynode* next; struct mynode* prev; }; mynode * headptr = NULL...
[no replies]
Control Breaks
 
// CIS225C1-8SampleReview.cpp : main project file. // /* Open Input File IF Input File Not Found THEN MSG “Unable to locate File” Retur...
[no replies]
by CroCo
#ifndef ?
 
I've quoted the following "The #ifndef directive shown in the rectangle.h header file is called an include guard and prevents a header file from accidental...
[12 replies] Last: @L B & firedraco, thank guys so much for being helpful and patient. (by CroCo)
by ls1984
decryption filter
 
Hello, How can decrypt the file that the program below encrypt? Please I need with this. // This program encrypts a file #include<iostream> #include...
[2 replies] Last: agree with randisking, however in some cases there are no way to rever... (by joneele)
comparing a value to a array and outputting
 
i have 3 arrays total, 2 of them i am comparing to see if any of the values match at all, and then i am putting the value that matches into the 3rd array. curre...
[1 reply] : by looping twice... So Do something like this int m = {1,2,3,4,5,... (by joneele)
Need help with a Data Structures program
 
1.Create a C++ project with the program file below 2.Run the original program on the original data and see that your output is as below. **note that the fi...
[2 replies] Last: I'm asking for the code that will allow the checking of pairs and prin... (by jctcis2014)
trying to insert data into the middle of an array
 
when i try to display the altered string after my modifications it gets put out in ascii and says data around the stack was corrupted. heres the function v...
[no replies]
February 2013 Pages: 1... 3435363738... 43
  Archived months: [jan2013] [mar2013]

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