49,761 Topics

Member Avatar for
Member Avatar for goulda660

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 …

Member Avatar for daviddoria
0
205
Member Avatar for Tellalca

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. …

Member Avatar for Tellalca
0
187
Member Avatar for macobex

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] …

Member Avatar for n.utiu
0
134
Member Avatar for n.utiu

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; …

Member Avatar for n.utiu
0
109
Member Avatar for karolik

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 …

Member Avatar for karolik
0
140
Member Avatar for tarheelfan_08

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 …

Member Avatar for tarheelfan_08
0
255
Member Avatar for tjlee87

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 …

Member Avatar for tjlee87
0
108
Member Avatar for Asheem

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 …

Member Avatar for WaltP
0
127
Member Avatar for Asheem

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 …

Member Avatar for WaltP
0
179
Member Avatar for lawyf

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 …

0
47
Member Avatar for Frederick2

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 …

0
62
Member Avatar for Martje

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.

0
47
Member Avatar for JohnPhilipps

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" …

Member Avatar for JohnPhilipps
0
217
Member Avatar for timbomo

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 …

Member Avatar for timbomo
-1
93
Member Avatar for pearle

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 …

Member Avatar for pearle
0
1K
Member Avatar for Jaxzen

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 …

Member Avatar for WaltP
0
143
Member Avatar for ahmed hefnawy

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 …

Member Avatar for WaltP
0
73
Member Avatar for timbomo

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]

Member Avatar for Sumyungi
0
107
Member Avatar for Jaxzen

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 …

Member Avatar for Lerner
0
928
Member Avatar for apo

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 …

Member Avatar for apo
0
304
Member Avatar for rawan_22

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++ …

0
53
Member Avatar for some

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 …

Member Avatar for some
0
136
Member Avatar for Talguy

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 …

0
68
Member Avatar for Alicito

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 …

Member Avatar for Alicito
0
106
Member Avatar for josolanes

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 …

Member Avatar for josolanes
0
363
Member Avatar for euclid135

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 …

Member Avatar for euclid135
0
116
Member Avatar for atticusr5

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 …

Member Avatar for atticusr5
0
170
Member Avatar for buzzykerbox

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 …

Member Avatar for Lerner
0
180
Member Avatar for artikapri

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 …

Member Avatar for jephthah
0
48
Member Avatar for random12810

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 …

Member Avatar for strmstn
0
2K

The End.