49,761 Topics
| |
I was having some issues using a rendering worker thread in my application and created a stripped down application to troubleshoot, but stumbled onto a problem that is probably so obvious I am just completely overlooking it. The pertinent code is as follows: [CODE] BOOL GameDlg::OnInitDialog() { CDialog::OnInitDialog(); pDC = … | |
Hi, I want to make an array of strings like this: [code=c]string s[4]={"a", "ab", "abc", "abcd"}; [/code] Then I want to write a class with a pointer to a string (and not an array of string pointers). [code=c] class someclass{ public: // constructors and other member functions here private: string … | |
I need some serious help as I am on a deadline for tomorrow afternoon. I will give the instructions for the program followed by the code that I have... Create a utility that transfers words that are palindromes in the input file into the output file. Place a space between … | |
Question 1 In C++, no name is associated with the pointer data type. True False Question 2 The statement int **table; declares table to be a pointer to a pointer. True False Question 3 Which of the following arithmetic operations is allowed on pointer variables? a. Modulus b. Multiplication c. … | |
Hi guys I need some help with an idea i have. I work for a company that does monthly audits of items in a grocery chain. I have all my field reps setup to use excel files to complete their audits and then they send them to me. At the … | |
Hello guys, This class creates aDie object by using aRandomNumberGenerator and the concept of composition. The program works if the member object aRandomNumberGenerator is not declared static. Otherwise I receive the error "undefined reference to aDie::gen." I do not understand why this happens, isn't gen within the class scope? Even … | |
I can't figure it out. [CODE] #include <iostream> #include "GameMenu.h" #include "PlayerInfo.h" using namespace std; GameMenu::GameMenu() { } void GameMenu::display() { cout << "-----------------------------------------------------------------" << endl; cout << "Welcome to \"Hot or Cold\"" << endl; cout << "-----------------------------------------------------------------" << endl; cout << "OBJECTIVE:\t\tGuess the number in fewest number of guesses." … | |
I was wondering how one would go about creating a structure that cannot be used by itself, i.e. only through a wrapper class. My question is what would be the syntax for this construct? I'm currently on a personal project to make simple tests from old tests, all the questions … | |
So i did tons of research for bout 2 hours on google and finally figured out how bit-level works when using XOR, but most of the time, the vars were already declared I wanted to know how to declare them but by user input. This is just an example i … | |
[code]#include <iostream> #include <string.h> #include <fstream> #include "class.h" using namespace std; translator a[100]; int d,b,c; int n; int m; int x; int z; void translator::add() { ofstream iFile("singular.bin", ios::binary | ios::app); ofstream dFile("definition.bin", ios::binary | ios::app); ofstream pFile("plural.bin", ios::binary | ios::app); ofstream aFile("articol.bin", ios::binary | ios::app); ifstream gFile("nr.bin", ios::binary); gFile … | |
Hi I am trying to do a homework problem but this is about as far as i have gotten. need some help if you will. also am a complete novice so would like it if you explained in baby terms :) Sorry... am trying to solve this problem... You have … | |
Hi buddies, I have a project that I need to be plugin based. I have never done that before and I have intermediate C++ knowledge. I have googled and found a lot of links including [URL="http://www.abstraction.net/ViewArticle.aspx?articleID=67"]this one[/URL]. It is helpful and I don't know if I understand well. Here is … | |
hello, i have some simple questions but i don't know why my code is not correct see these questons: 1-Write an algorithm to accept three numbers and display the largest one? this is my code [CODE]int num1,num2,num3; cout <<"Please enter three numbers:"; cin >> num1 >> num2 >> num3; if(num1 … | |
My daily text editing question.... I'm traversing a text file line by line adjusting the text so that the file eventually will match the syntax required to be run on a MIPS simulator (MARS). My issue is that whenever I see a line with the string "blezl" in it, I … | |
how to add a stop watch with a pause button in my mfc application | |
Ok so I dont think I have installed ANY compiler for C++ on my Windows Vista system. So I would need info about that as well. Anyhow. Just like java can be run using javac and then java w/e w/e... how do I run my .cpp notepad files via the … | |
Guys, Why do we have these unresolved externals? This is the second time I am meeting them, and I'm sure it is a common problem. I've defined all the constructors including a void constructor just for the sake of (I don't actually need it). Pray tell where the error is: … | |
How do I add a capital 'N' to the end of my loop so if the user clicks N or n then we will not continue?: [CODE] do{ }while (con!='n'); [/CODE] | |
Would anyone have a C++ program that will prompt the user to enter the number of students and subjects that have been marked, the user should be able to enter the names of the students and subjects and the user should also enter the associated exam results. The program should … | |
hi.. i'm trying to load a file with .pgm extension on picture box ... i really need help .. so .. any help here??!! :( | |
Hello, i have a question to the people who already have read chapter 7-4 in this book. This example is driving me crazy! :x [CODE]typedef vector<string> Rule; typedef vector<Rule> Rule_collection; typedef map<string, Rule_collection> Grammar;[/CODE] So, this would without typedef be like this: [CODE]map<string, vector< <vector<string> > > >;[/CODE] But, why … | |
I am trying to make a program that lets the user create objects of a class UNIT which are then stored in a list. I was able to get that to work, but now I want the user to be able to find a specific UNIT in the list by … | |
Hello friends, I am working on a problem where i need to dump huge amount of data from a file into a tree for analysis. The data in the file would be in specific format something like given below: node1 child1 child2 child1 child3 child4 child2 child5 child6 Since there … | |
I'm using a cross-compiler that generates MIPS binaries from c++ (mipseb-linux-g++). What I want to do is tell the compiler to use a specific ISA (namely MIPS I). From what I can tell this is a machine option that should be easily configurable. I've tried changing the option in my … | |
Hello everyone! I wrote a basic c++ program using classes and pointers. Although it compiles without any errors, it will not run, saying "This program has stopped working". I am assuming that this issue may have been created by a memory leak, but I made sure to delete all dynamically … | |
Hey All. I'm trying to figure out how to search for a string within my file and if the string exists, I want to get whatever follows it. Here's an example: HighScores.txt ---------------------------- Devin: 202 Corey: 185 Nick: 315 Patrick: 112 ---------------------------- If my program opens the file, I'd like … | |
Hi all, I am trying to link to an external library (the boost regex library) under gcc. I am ashamed to admit that what I know about linking external libraries comes soley from modified snipets from online forums. My problem is as follows; I use to keep all my source … | |
Hello, I am trying to calculate the value of pi (just for fun, I know it's already done for millions of decimal places), the program I made works fine, but the problem is that, it is constrained by the accuracy of [I]double[/I] values. Is there anyway to create 'extendable' floating … | |
Hey, I have the following codes: [CODE] // In Form1.h protected: ItemGroup^ History; ItemGroup^ Favourites; [/CODE] [CODE] // In Form1(void) History = (gcnew ItemGroup()); Favourites = (gcnew ItemGroup()); [/CODE] [CODE] // ItemGroup public: ItemGroup(void); int Length() { return _length; } Item^ Items(int _index) { return _items[_index]; }; void Add(String^ _text) … | |
Hey guys and girls, I am extremely new to coding, and I would appreciate some help. I am trying to write a code in which someone inputs a number, which is part of a file name, then I do stuff with the filename. Here is the part that I am … |
The End.