49,761 Topics
| |
I have been trying to write this program for this class that I'm in. The main objective is to make it able to save drivers to a file and then just be able to look up the drivers and then save them back to the file. I thought that if … | |
Hello everyone, i was just trying something when i got the error. I debugged and it says string password <Bad Ptr> and that password string have more than lets say 100000 childs of characters in it. I used the string::resize() member function but it doesnt seemed to solve the problem. … | |
I've just learned how to use vectors. I'm thinking about, what is the best way to create a vector, IF you do not know its initial size. Here are some of my options. 1.) This is the simplest I think, but is there any memory issue about this technique? [CODE] … | |
I have been recently experimenting with functors and tried o make my own one, inheriting from unary_operator, but I get some errors. [CODE] template <typename T, int intN = 0> class cIsBad : public unary_function <T, bool> { public: bool operator() (const T& tParameter) const { return tParameter == intN; … | |
So I have a program that reads data/text files, with 1 number on each line and makes a binary search tree from it. When i insert a node, there should be two data variables updated, searchcost and key.. Key being the actual number of the element, and the searchcost is … | |
Hey guys I am trying to do some work with exception handling and I had to create and array with 100 elements in the main to hold cars in inventory, and create and int numCars to hold number of created cars. Then I had to create a for loop that … | |
Hi, I have trouble with the "enqueue" section of this code, can anyone here find the fault within my code. I've been working on this for over 15+ hrs and I can't not find what I am doing wrong here. If there is anything else I need to provide, I'll … | |
The program needs to read a file, in which position are mentioned in form of 0 and 1, and location (i,j), of the robot, who has to go the end point has to, generate numbers, randomly, BUT ALSO STORE THOSE LOCATIONS SO THAT THE ROBOT DON'T GOES TO THE SAME … | |
The program needs to read a file, in which position are mentioned in form of 0 and 1, and location (i,j), of the robot, who has to go the end point has to, generate numbers, randomly, BUT ALSO STORE THOSE LOCATIONS SO THAT THE ROBOT DON'T GOES TO THE SAME … | |
Hey all, I have manage to create a program which sniff and response to the snmp command returning the default value to it various parameter. However when the user will to set a new value to the parameter, instead of displaying the new value the program response with the default … | |
Will an int in C/C++ now be 8 bytes instead of 4? printf("sizeof(int) = %u\n", sizeof(int)); sizeof(int) = 8 In DOS it was 2 afterrall. And what about doubles? Will they be 16 bytes? Maybe call them 'fourples'... I really don't know. Me and my employeer are stuck in 32 … | |
Hey all, how do i retrieve the names(string) of all the cd drives and usb drives available? for example if my cd/usb is named "Pencil( D: )" i want the name "Pencil" to be retrieved. Thanks in advanced. | |
Good evening, I have been working with derived classes and what could seem like an easy problem has had me look into it for hours. [U]My error message:[/U] Square.h(14) : error C2512: 'Rectangle' : no appropriate default constructor available Everything works well if I don't use my derived class "Square.h" … | |
I cant figure out why this D::D:: is coming up when i generate a random number. idk i looked at other pages and the code looks fine . [CODE] int roll_hold( char answer1, char answer2) { int numb_on_dice1,numb_on_dice2,play1, play2,next_player,play1_total, play2_total; char f,s;// first and second player. cout<< " Would you … | |
Suppose I have something like [CODE]char *threeDays[3] = {"Monday","Tuesday","Wednesday"};[/CODE] and I wanted to extract the first letter of each string and create another string using those letters. How would I go about doing it? I tried [CODE]char str[4]; strcpy(str,*(threeDays+1)); strcat(str,*(threeDays+2));[/CODE] but that gives me "TuesdayWednesday". I just want a string … | |
I need to turn the characters in a string that's generated from a data file into *'s and make it visible to the user. [code] #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main() { int numph; //First number in .dat file saying how … | |
peace up on u everyone.. i wanna make a program in c++ include to make more than one matrix and i can make all calculations like + * - / on them like multiply 2 matrices ........... and i can save the matrix in program and i can Retrieves it … | |
how do i return to another part of the program like the begining [CODE] if ( letter=='y') { return letter; }[/CODE] i want it to return back to a prototype [CODE] int roll_hold( char answer1, char answer2)[/CODE] | |
My code is supposed to take numbers from an .txt file, assign them variables, print out the numbers and THEN if the number is less than 25, add them up according to parity. So, if the list of numbers is 1,2,3,4,5 It'll output: 1 2 3 4 5 Sum of … | |
Hi, here is the thing, I'm trying to make my university grading table on C++, when i fill in the grades it should tell me what i have accumulate. the thing is that when i insert the text grades it shows a zero when i click the buttom. the math … | |
Hi all, Please I want a help, I used the mouse hook and I want to get the selected text in a windowand the title of the window. can anyone help me how to do this ? What API's can help me and get the text ? I using c++ … | |
Here is my code, I am trying to make a smaller version of a chatterbot like Eliza. Anyways here it is.[CODE]#include <cstdlib> #include <iostream> #include <cstring> #include <stdio.h> #include <string.h> #include <string> #include <windows.h> #include <fstream> #include <tchar.h> // a few global variables char str[50]; // this one is for … | |
I am trying to draw a gradient in a rectangle using cairomm. I found the code below which helped a lot. My problem is I want to turn this rectangle into a progress bar. Is there a way to modify the code so that it at a certain percentage of … | |
Hello Friends I'm facing a problem and I can't figure out what is the wrong ( it is [COLOR="Red"]a Run~Time~Error[/COLOR]) I have these two classes [CODE] // singly-linked list class to store integers #ifndef INT_LINKED_LIST #define INT_LINKED_LIST class IntSLLNode { public: int info; class IntSLLNode *next; IntSLLNode(int el, IntSLLNode *ptr … | |
I'm using [this website](http://stdcxx.apache.org/doc/stdlibug/33-3.html) as a reference and am modifying some code to (hopefully) have it work the way I'd like it to. I *think* I'm close, but since I have no experience with custom paramaterized output manipulators (and have limited experience with custom output manipulators even) I'm kind of … | |
Hi all, I want to use some container for this case: i have 4 elements, say string1,string2,class1,class2. I need string1,string2,class1 to be united, means if i access string1 in this container you'll get class1. The problem is class2 is something flexible, sometimes it can be written, sometimes it can be … | |
hey everyone, newbie programmer here, and i am working on a project to use linked lists, by creating a linked list class. basically i am using old code and modifying it to work with a linked list class. i am using visual studio to debugg, and it seems that my … | |
This is an assignment for class,design a hangman program,I convert the letters of the random word to charchters,when the user inputs there letter how do I compare that with the secret word, and display it,any suggestions???? [CODE] for(int i = 0; i<word_to_guess.size();i++) { word_to_guess[i] = 'X'; } cout<<word_to_guess<<endl<<endl; while (lives>0 … | |
i hav 2 forms Form1 n Form2 in visual studio c++ 2005.i called form2 from the form1 thru a button which is in form1. Using the following code form2 opens but form1 is still visible behind form2. [code]Form2().ShowDialog(); Form2().Activate(); Form1().Close();[/code] i want only form2 to be visible .how can i … | |
I have no idea how to move a bitmap with the arrow keys. Here is my code [CODE] #include <windows.h> #include <tchar.h> #include <stdlib.h> #include <string.h> #include "Menu.h" #include "Icon.h" LPCTSTR ClsName = L"App"; // Class name LPCTSTR WndName = L"WindowsAPI"; // Window title HWND hwnd; // Handle to our … |
The End.