49,761 Topics
| |
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. … | |
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. … | |
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 … | |
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++] … | |
How can i use the defined functions into the forms? | |
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 … | |
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 … | |
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, … | |
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 … | |
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); … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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... … | |
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> … | |
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 | |
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, … | |
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 … | |
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 … | |
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 … | |
#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: "; … | |
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 … | |
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 … | |
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 … | |
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. … | |
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; … | |
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 … | |
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, … |
The End.