49,757 Topics
| |
Hello, I am having a problem when I am trying to create a new node. The problem is on line: [CODE] tnode->lc= new cttNode; [/CODE] Here is the template the problem resides in: [CODE] template <class B> int ctt<B> :: insertIfNew(const string &key, const B &index) { cttNode<B> *tnode= root; … | |
Hi Got a webBrowser control on a form displaying ads from a server, trying to load page in the default browser when user clicks on a banner within webBrowser control, by default the control always load pages within IE Browser which is not really what one wants. This is about … | |
Hi, I've got an assignment at school that I would really like help with. I'm a total newbie. [code=c]#include <iostream> using namespace std; int main() { char chr=(char)67; unsigned int offset = 1000; char * ptr=(char*)0; ptr+=offset; cout << ptr[0] << (char)43 << (char)(chr-24) << endl; } [/code] The questions … | |
I have a major concern about this. Recenlt i am doing a sequenclick game. in 16 boxes, when start, there are randomly 16 different numbers coming up. | |
Hello, im a noob with C++ at the moment and Im trying to create a BMP image from pixel data stored in a array. Everything seems to work except that when i look at the file generated in a hex editor i get an extra '00 00' in between the … | |
Hey everyone!! I am having trouble printing the whole of a multidimensional char array. [CODE] #include <iostream> using namespace std; int main(){ char array [5][10] = {"---------", "| |", "| |", "---------"}; cout << array << endl; system ("pause"); return 0; } [/CODE] It just gives me random numbers and … | |
please any one give me the code of this program using nested for loop * ** *** **** ***** please see attachment for correct question | |
Hi all, I just want to ask about setprecision because I'm a bit confused. here's the code: [CODE] #include <iostream> #include <iomanip> using namespace std; int main() { double rate = x; cout << fixed << setprecision(2) << rate; }[/CODE] where x = to following: the left side of equation … | |
I was a C++ trainer for 3+ years and now am a developer with a software company. Last week, i had to undergo a C++ test on [url]www.brainbench.com[/url], as a part of my company's internal assessment. I scored 3.5 in the test (I'd gone unprepared at all). Can someone please … | |
im trying to get this function to show the numbers that are not on the list in the input file, i've written this and it doesnt work, i know theres sometihng wrong with it but im not sure what it is? or how i can fix it to make it … | |
OK! i have a problem. I'm making a game with a character you control and theres monsters that move when you do and when you run into a monster i have it so you lose 1 life. (iLife --; ) i set iLife equal to 4 at the start. if … | |
I know the how to fill a magic square but there is a problem in the code. The algorithm is like below: 1-Put number 1 at the second column of first row. 2-Put the next number one upper row and one behind column. 3-If the cell mentioned in the last … | |
Hi guys im trying to generate 5 random numbers that return a string so i can compare it to a file. so far i have this but i have no idea how to make it a string. Since i have to compare it to the file i mentioned earlier. This … | |
Hi! For the past few months I've been self-learning C++ with the book "C++ Primer Plus" by Stephen Prata. After having gotten through chapter 7, I decided to check my progress by writing a little program, Baztro. Baztro stands for Basic Astrology Tool. It asks you for birthdate(s) and will … | |
Hi, I'm new to programming and I'm doing a course in uni. I'm currently using "Dev-C++". I've been away on holidays and haven't been able to grasp the work we're doing now. I would really appreciate it if any of you C++ programming geniuses helped me with my work as … | |
I have to "re-write" the program that I wrote before. Here is the prompt of what to do: Overview For this assignment, re-write program 7 so that rather than using multiple arrays to hold the player information, it uses a single array of structures. The structure that will be used … | |
I'm getting a "IntelliSense no default constructor exists for class "Person" line 71." Also am getting error c2512: 'Person:' no appropriate default constructor available... There is a constructor there which confuses me on why I'm getting an error? [CODE]#include <iostream> #include <string> using namespace std; class Bio { public: Bio(); … | |
Hi! Im finishing up a lottery number generator and the only part im kinda lost in is the binary search part. I have two strings = input[], random; I have to go through each subscript and check if it matches my already random generated number. Thanks in advance to those … | |
The program below crashes anytime I run it, can anyone tell what I have done wrong?. [CODE] #include <iostream> #include <cstring> using namespace std; class Human { private: char *fname; char *srname; char *phone; public: char * getFirstName(); char * getLastName(); char * getPhone(); Human(char *fn, char *sn, char *ph); … | |
Program is suppose to convert binary to hex.. it says that i need a class/struct/union to the left of ".substr" but im pretty sure convert should be working.. [CODE]#include <iostream> #include <string> using namespace std; int main () { string convert [8]; string bin[16]= {"0000", "0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; string hex[16]= { "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; … | |
My professor gave us an assignment to Convert the following 2 numbers to binary, octal and hex. 3.567, 0.032432 which would be easy if the numbers given weren't in decimals. I'm using the % operator and that can't be used by float... I'm lost. Can someone give me an idea … | |
I am a 22 year old college gal currently enrolled in a c++ course, and we are on the topic of recursion. I understand how it works and have completed several other exercises on the professor has listed in the book, but this one has me stumped. Is there anyone … | |
Can someone help me out with this program. Programming problem – This program must meet the following criteria: 1. Character reading loop: i. Requests the user to enter a character at the keyboard 5 different times. ii. Reads in each character using getchar () within the loop. iii. Verifies that … | |
Hi, I have a program which needs to accept a date, it can only accept under 30 days, and the entry has to be over 0 My problem is that it accepts anything, it doesnt make sense because i have used the exact layout on other bits of code which … | |
Hey, I've got this code that scans a 3x3 section of a 9x9 array. Heres the code: [CODE]for (j=x; j<x+3; j++) { for (i=y; i<y+3; i++) { if (array[i][j] == value) { cout<< "Number already used in Section" << endl; } } }[/CODE] It works fine if you start from … | |
Is there any way to implement a scope change for the template keyword? I have a templated class with almost 100 different functions and my code looks disgusting with my external declarations. Is there any way to implement a scope increase for template? EG: [CODE]template <typename Type> class TypeClass { … | |
I'm REALLY angry! I've been trying to get this stupid code to compile for way too long now. I've spent 30 bucks on this book and the first code it tells you compile doesn't work! Here's a link to the code... [url]http://d3dcoder.net/d3d10.htm[/url] I'm sorry that you have to download that … | |
So this is my final project for my class. The idea is to use my RationalNum class (which is complete and works fine... I just didn't attach the .cpp since it was only the driver) and use it to add, sub, & multi polynomials (RationalNum being the coefficients i.e. 1/4x^3 … | |
receiving this error: error C2011: 'Placement' : 'class' type redefinition please help! this is due soon. | |
so im starting in C++ programming and im working out of a textbook. At the moment im stuck on the question asking me to determine using an input(cin) whether an input is a lowercase or uppercase letter. I am particularly confused on how to determine if an input is upper … |
The End.