49,761 Topics

Member Avatar for
Member Avatar for JohnKeays

I am doing a simple dialog box that has a status reply and I want to change the colour of the text to yellow for a caution, red for an error and say green if it is okay. I have tried and failed to use Settextcolor() in the dialog box. …

Member Avatar for nucleon
0
87
Member Avatar for pt_solar

Hi I need to find the mode and I'm just not getting the right output for the mode. The program is supposed to find the mode and display it if it exists and if it doesn't exist it's supposed to display -1. Any help will be very much appreciated. Thanks. …

Member Avatar for Clockowl
0
2K
Member Avatar for abhi.nalluri

I have developed a GUI where in I need to update some(4) parameters in a ListBox.I am usind the following code to do this. [code] CString tmp; tmp.Format("%4d %4d %4d",a,b,c); listBx.AddString(tmp); [/code] a,b and c are integers.listBx gets updated every 1 sec. But I am not getting the output in …

Member Avatar for MrSpigot
0
97
Member Avatar for Gerlan

Hey All, I have stumbled upon a small problem while using an fgets function. I need to make a program that reads in lines from a text file (text file is entered via command line) Here is a little snippet of the code (concerning only the fgets function :P) [code=c++] …

Member Avatar for Gerlan
0
122
Member Avatar for viji.sarathy
Member Avatar for shazzy99

Hi, How can I show a long value returned from a function to a textbox on a dialog box. Void CVideoDlg::OnBnClickedFrames() { m_AMC.get_FramesDrawn(); // retunrs long } I want to display the returned value in textbox as well as a messagebox. I tried MessageBox(CString(m_AMC.get_FramesDrawn())); But it didn't work out anyone …

Member Avatar for Nick Evan
0
206
Member Avatar for joejoe55

Could someone give me some function names to google for? Im trying to detect a left mouse click in an area which happens to be inside a game window. Just need something very primitive to get what it to do what I want. I know im going to need the …

Member Avatar for Nick Evan
0
133
Member Avatar for Esmeralda

This is what I am doing but I am stuck here can you help me?? // Winning Division #include <iostream> #include <iomanip> #include <cstring> using namespace std; // Constant for division name array size const int NAME_SIZE = 26; // Function prototypes double getSales (char []); void findHighest(double, double, double, …

Member Avatar for adam1122
0
127
Member Avatar for jazzezselvan

Hi All, A error message is thrown on the compilation of C++ code. The error message is error: expected initializer before '*' token Also i am attaching the C++ file here with. [code=c++] /* $Id: Debug.h,v 1.1 2005/06/23 13:47:50 srinivasar Exp $ */ /* * Copyright 1999-2001 AdventNet, Inc. All …

Member Avatar for jazzezselvan
0
112
Member Avatar for gretty

Hello I am trying to calcuate the square digit length of a number. I have written a code but I am getting an error with the "pow" function & I have no idea what is wrong? Can you help me? [CODE]#include <iostream> #include <cmath> using namespace std; int squared_digit_length(int n1); …

Member Avatar for adam1122
0
96
Member Avatar for guest7

Hi, I am getting the error "Segmentation fault" when i run my program. Then when i debug the code to find the cause of the error i get the following error messages. I do not know what these error messages mean: Error Message: ------------------------------------------------------------------ Program received signal SIGSEGV, Segmentation fault. …

Member Avatar for rm_daniweb
0
95
Member Avatar for SeeTheLite

Alright so I have a header file that includes another class with a pointer to a structure as a private variable. Does my second header have to be a pointer too or can it be static? [code=c++] #ifndef EXAMPLE1_H #define EXAMPLE1_H struct ex { int blah; char meh; }; class …

Member Avatar for Ancient Dragon
0
62
Member Avatar for JainishP

For a assignment I was to write two functions to sort a array. One using selection sort and other using insertion sort. The thing I was stuck on was the part that said, "// insert code to display intermediate permutations". I assuming that wants me to write a code to …

Member Avatar for VernonDozier
0
106
Member Avatar for badboizEnt

please i need help with my code below, when ever i enter a wrond password first it gives me an error which its suppose to, but when entering the correct code next it still gives me an error message. could someone help me counter this problem. cheers [code]#include "stdafx.h" #include …

Member Avatar for badboizEnt
0
160
Member Avatar for Icebone1000

I dont know how to explain very well, I have a class that works 100% fine.. The problem is that now I want access that class inside of other class, when I do it, things stop of working fine and gets very unstable( some few times works, but mostly times …

Member Avatar for Icebone1000
0
275
Member Avatar for Akis2000

hi.....here is my code::: [CODE]int main() { srand((unsigned)time(0)); int random_integer,num,len; cout << "Random numbers: "; cin >> num; cout<<"Lenght of each numbers: "; cin>>len; for (int i=0; i<num; i++) { cout<<endl; for(int j=0; j<len; j++) { random_integer = rand() %10 ; cout << random_integer; } } [/CODE] my question is... …

Member Avatar for Akis2000
0
110
Member Avatar for Clockowl

Hey guys, How do I disable/get rid of that default exception message windows shows when you have an "unhandled" exception in your program? Here's my example code (sorry for not limiting the code's size to the problem only, it's readable enough I think): [code=cpp] #include <iostream> #include <fstream> #include <string> …

Member Avatar for Clockowl
0
159
Member Avatar for rudolph2004

Hi, I need to create a function that will allow me to search for records in a struct. Any ideas if how to get started? Thanks

Member Avatar for rahul8590
0
80
Member Avatar for Clockowl

Hey guys, I've this code: [code=cpp] #include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; bool load_file(const string &filepath, string &dest){ ifstream file; file.open(filepath.c_str(), ios::binary); if(!file.good()){ cerr << "Fatal error while opening file." << endl; return false; } //get filesize in bytes from ifstream //seek end, get pointer, …

Member Avatar for Clockowl
0
994
Member Avatar for rudolph2004

Hi, I have been asked to create a small programme that asks a user how many students information they would like to enter and then asks the user to enter all their information storing it all into a struct. The above is all good I know exactly know how to …

Member Avatar for unbeatable0
0
129
Member Avatar for lionleo

program that produces a report with a header line containing the total sales and total expenses. Following this header should be a table with each salesperson's name, percentage of total sales, and percentage of total expenses, sorted by salesperson's name. the text file should be like the following form bob …

Member Avatar for ithelp
0
77
Member Avatar for tag234

hi guys... im having a problem figuring out exactly how to fill a dynamically allocated array of doubles. bool getData(double **x, double **y, int n) my function is passed these two pointers to pointers and, in the end, they are supposed to point to the addresses of dynamically allocated arrays …

Member Avatar for siddhant3s
0
82
Member Avatar for jam7cacci

#include <iostream.h> #include <string> void main() { char name[10]; int num_name; int count; cout << "How many names do you want to enter?\n"; cout << "Answer: "; cin >> num_name; int j =1; cout << "\nEnter names\n"; for (count=1; count<=num_name; count++) { cout << j << "." <<" name: "; …

Member Avatar for jam7cacci
0
107
Member Avatar for joejoe55

Never done this successfully before and can't seem to figure it out... Any help appreciated. Basically this code draws my Winamp Track like this; "Song Title - Song Artist - Winamp 0:00/0:00" I would like to remove the - Winamp from the drawing if possible, any pointers or code would …

Member Avatar for VernonDozier
0
111
Member Avatar for ejiroy

I am trying to make a program that computes gross by using a class and three functions. When I try to run it, it gives me this error I think something is wrong with my set function and my int main function, any help would be appreciated, I think it …

Member Avatar for VernonDozier
1
91
Member Avatar for pt_solar

Hello...I'm trying to write this program answering this question and I keep getting C2440 errors and C2664 errors and I did some research but couldn't find anything on how to correct it. The question says : Write a program that dynamically allocates an array large enough to hold a user …

Member Avatar for pt_solar
0
544
Member Avatar for SCHarris

I am quite new to C++ and while trying to 'link' functions (methods?) together to make more interesting code. I found that you cannot call a function that is below the function you are calling it from. example: main() { "code" run(); } run() { "code" } This doesnt work. …

Member Avatar for SCHarris
0
82
Member Avatar for boydale1

I can't seem to figure out why there is a segmentation fault in my copy constructor. [code]Set::Set() { Num = 0; Head = new (nothrow) Node; Head->Succ = NULL; } [/code] [code]Set::Set( const Set & A) { Node * Temp = A.Head->Succ; while ((Temp) ) { insert(Temp->Item); Temp = Temp->Succ; …

Member Avatar for Ancient Dragon
0
106
Member Avatar for neox183

My homework problem is the following :Write a program that accepts a string from the user and then replaces all occurrences of the letter e with the letter x. I got the following code below that can recognize to find characters and where they are at but I don't know …

Member Avatar for neox183
0
134
Member Avatar for M^2

suppose the input file is... 5(number of cells) 1 2 -1 4 0 2 3 4 1 0 3 -1 2 -1 3 1 2 0 1 -1 how will i Write a function to read data from an input file to create a dynamic array of pointers to cells, …

Member Avatar for M^2
0
105

The End.