51,593 Topics
![]() | |
there's something wrong with my program, it runs but it goes on forever and it doesn't display the day of the week only the letter M and that's it this is my text file, but my program is not suppose to be restricted to this text file: Monday Tuesday Wednesday … | |
In the following code, why x=new int; y=new int; are a must, if I comment out these two then I will have run-time error. I think I have int * x; and int* y; already shows that x and y are pointers point to int. There is no need to … | |
So I finally finished writing a program to build a maze using disjoint set (I just learned it =P). Anyway as I was writing my program, I was under the impression that I could start from the end of the maze and I could climb up to the parent node … | |
Hi, I'm trying to write a program using enum to store data. The user needs to input the first two letters of a word and the program outputs the full word. Here is what I have, but for some reason I cannot get it to run (visual c++ express edition). … | |
I have a homework problem that i am stuck on. I have to create a triangle (using classes) that a user inputs the height and width. It then translates 3 times and prints the coordinates each time it translates. This is what i have so far but am stuck. #include … | |
This is what i have done so far but i want the output like that square#1:not an increasing square square#2: increasing square square#3: not an increasing square please help Help with Code Tags C++ Syntax (Toggle Plain Text) [CODE]#include <iostream> #include <fstream> // Header to use input and output #include … | |
Hi: I have a MS Access file with the name "ItemsCat.mde. It is located at "c:\program files\ItemsCat" folder I need a C or C++ program (what ever it is) I don’t now the difference. I need it to do the following please? No#1- run my ItemsCat.mde file from this path … | |
Hello I'm a newbie to C# and I'm looking forward to learning it. I know the best way to learn something is to practice, but I can't think of anything to make. I'm most interested in developing applications that interact witht he web, but I have also had an idea … | |
I want to filter the global operator new and operator delete. For example, this could be used to count the number of times they are called and check at the end of a program to see if they match for memory leak detection or other purposes. I do know perfectly … | |
I'm creating a program to Deal, Sort, Display and determine cards for a poker game. A word for word of my program is here... [QUOTE]Write a program that will operate on a deck of 52 cards. Your program will: 1. Deal them into four random hands of 5 cards each … | |
Hello, I'm doing an analog clock windows forms application in Visual C++, and for this I need to draw a few lines in a blank space inside the form. I've searched the Net but can't find a simple way to draw inside a form window. Any Ideas? | |
Hi, I'm working on a c++ homework assignment and I cannot get it to work. Here is the assignment: Write a program that reads a student's name together with his or her test scores. The program shouuld then computer the average test score for each student and assign the appropriate … | |
hii everyone1.. how can i update a text file i,e only one particular record in a file i'm using openGL with vc++ ... my sample code to write into a text file when a store button is clicked is over here..after every 8sec i have to update only x_quad and … | |
Hi, do you know some good tutorial about WinForms to change data in table, when OCCI is used? I used google already. Thanks you very much | |
i am soryy my english is very bad but ill try my best to explain.i need help with my c++ assignemnt urgently. i want to create a frame and fit in this histograph(attached) which i made with the help of the container, where the x-axsis is the number from like … | |
Hi Guys, Im having issues with clearing an object of a class. Currently I have 2 lists [CODE]class People list<char> person[/CODE] [CODE]class School list<people> teacher[/CODE] i add the contects of person into people; i read by executing the printChar function created in People whilst iterating in the School list. [CODE]itr … | |
Hi for some reason my array prints out a bunch of 0's and other unwanted integer garbage. I can't see why because i originally assigned number to an array 1-31 using something like `array[]={1, 2,3...31}` something like that, and then i use a for or while loop in the code … | |
hello, im not understand concept of recursion function and the uses...have anybody explain to me... second how to write a recursive version of function to determine if an input is prime... | |
Hi everyone. First I would like to apologize if I didn't post this correctly, so please don't take it hard on me if I did. Here is my problem: I have to print out a system filled form, including text styles. For example (I have already solved the styling issue) … | |
Hi i would like to know how i can navigate through a 2D doubly linked list. i have created a linked list of a linked list which are contained in classes Row and Columna Row list <char> X Column list <Row> Y; List X contains a b c d e … | |
mainly i have problem with the loops it's suppose to be a program that reads in data from a text file (not necessarily this one, but something like it): Monday Tuesday Wednesday Thursday Friday Saturday Sunday 34252 85776 65746 93453 63534 34335 0 20444 73462 83575 23552 23753 23532 0 … | |
Well, a few weeks ago, i messed up my PC ( The windows part, Linux remains perfect ), not big deal, just formated, and seeing the bright side, i updated to Windows 7 ( i was on Windos vista). Everything is perfect.... or was until now. I used to "compile" … | |
Is there a way to put a computer to sleep somehow other than clicking start, then sleep? I am using a shortcut to this right now: C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0 but it doesnt do the same thing as clicking "Sleep" in the start menu. I need a piece of C++ code, … | |
Hello, I am a non-cs student who has not really had any prior experience with C++ besides coding up a few simple programs on my own time. I am trying to implement the A* pathfinding algorithm and I have all of the logic figured out and written down in pseudo-code, … | |
Hi im very new to this but i am trying to write a progam that serves as a student database for a project at uni. Ive been stuck on this problem for ages now and can seem to spot the probably obvious mistake ive made. The code compiles but the … | |
I just want to ask if there's a site where I can download Savings.h header file, I just need it for my sample program, my Borland 5.5 dont have it and even Dev-C++. Thanks! | |
Hello, I need some help getting my program to read from a text file. Everything seems to be compiling fine but Im getting an error as soon as the program runs because, i believe, the information is not being inputted properly. Thanks for any help! [code] #include <iostream> #include <fstream> … | |
Hi, I have 2 backgroundpictures that I want to change every second in a loop. I beleive a backgroundworker and reportproress will work for this. But what I wonder is about these 2 pictures themselves. Normally you can compile a project with a one backgroundpicture put to the buttoncontrol but … | |
I have created 3 separate files but having issues with rationalnumber.cpp saying 'Rational' is not a class or namespace name. Any suggestions? Below is what should happen.....but I'm stuck thanks the RationalNumber class should overload the stream insertion (<<) and stream extraction (>>) operators. The stream extraction operator should prevent … | |
see this code with the queastion [CODE]#include <iostream> using namespace std; int main() { char str[30]; cout << "enter a word: " << endl; cin >> str; // if the user input: malaysia // so the output will be 3 because there are three charchter of 'a' return 0; } … | |
Ok i need to read in 2 files. The first file contains employee data, and second file contains employee ID# and the hours the employee worked. I need to matchup the ID numbers and add the hours, which i have done. my problem is if there is a invalid ID#, … | |
Hello new to the forum, I've been learning and working with C++ for a few months now and I've started to learn how to use strings. What I'm trying to do is take each individual line from a text file and dissect all blocks of text separate by a space … | |
Hello there! Expora here again. I'm trying to get the hang of functions now and I made a simple program to calculate percent but I don't seem able to get it to work I can enter the 2 numbers but when i get the results is something like 0041123f. Any … | |
I'm supposed to rewrite a binary search function so that it uses a generic type for array elements instead of just int. The only changes I made to the function are inserting the line "template<typename T>" and changing the line "int binarySearch(const int list[], int key, int arraySize)" to "int … | |
So I've been making a program for quite some time, and I've always just worked around this issue because the project wasn't too large, but I've recently been assigned a much larger project, and want to have more files and such. Anyways. Here's the rundown. main.cpp [CODE]... msg(hWnd); ...[/CODE] msg.cpp … | |
i want to read in several `4*4` squares of numbers from a file and determines whether or not each of those squares is an increasing square. file containing numbers 3 1 2 3 4 2 3 4 5 6 7 8 9 5 6 7 8 1 2 3 4 … | |
Hi, I have one program with DLL. Function OpenPort(portNumber) is in this DLL. It is used for open RS232 ports. The program is writted in VC++ Professional edition with using of MFC header. And in this program, there is this important parts for my question: [CODE] CReadSRNDlg::CReadSRNDlg(CWnd* pParent /*=NULL*/) : … | |
Hi, can you help me? I have this program and when I compile it, it write me this: 1>main.obj : error LNK2019: unresolved external symbol "void __cdecl OnMessage(unsigned int,long)" (?OnMessage@@YAXIJ@Z) referenced in function "int __stdcall DialogProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DialogProc@@YGHPAUHWND__@@IIJ@Z) 1> fatal error LNK1120: 1 unresolved externals [CODE] . … | |
Hey guys, after compiling my program I get the following error [code]Windows has triggered a breakpoint in *.exe. This may be due to a corruption of the heap, which indicates a bug in *.exe or any of the DLLs it has loaded. This may also be due to the user … | |
Hi. I am trying to create this password storing desktop application. So,I'll need to save all the usernames and passwords the user wants to store in a file and encrypt it,so no one can read from it. I can write an encryption class,but I'm afraid it will become very basic … | |
Is it possible to do function overloading with different return type? For example: [CODE] void myfunc(double x, double y); double myfunc(bool x); [/CODE] | |
I have an integer 'a'. It is a random number from 1-10. How do I express interger 'b' to be a random number from 1-10, but not equal to 'a'? Would it be something like this?: srand ( time(NULL) ); a = rand() % 10 + 1; b = rand() … | |
i cant figure out why this error is coming up saying that "exams" are undeclared identifier. all of them? // basic file operations [CODE]#include <iostream> #include <fstream> using namespace std; void read_file_in_array(int exam[100][3]); double calculate_total(int exam1[], int exam2[], int exam3[]); // function that calcualates grades to see how many 90,80,70,60 … | |
[CODE]#include <iostream> #include "IntStack.h" int main() { int i; TIntStack a(5); TIntStack b(20); TIntStack *ip = new TIntStack; for (i=1; i <=5; i++) { a.Push(i); b.Push(-i); } for (; i <=10; i++) b.Push(-i); TIntStack::PrintStack(a); a = b; TIntStack::PrintStack(*ip); delete ip; return 0; } [/CODE] [CODE]#ifndef INTSTACK_H #define INTSTACK_H const unsigned … | |
Consider these functions: [code] void OperateOnDoublePointer(double* a) { std::cout << a[0] << std::endl; } void OperateOnFloatPointer(float* a) { std::cout << a[0] << std::endl; } [/code] This works as expected: [code] double* c = new double[1]; c[0] = 3.3; OperateOnDoublePointer(c); [/code] but when I try to do this: [code] double* c … | |
Write a function that takes a C string as an input parameter and reverses the string. The function should use two pointers, front and rear. the front pointer should initially reference the first charachters in the string, and the rear pointer should reference the last charachter. rever the string by … | |
Hi, I'm hoping someone can help me figure this out. I have to write a program to average scores and print grades using structs and arrays. It's a problem for my class and I think I'm close to finishing but I'm just missing something...maybe a couple of things. I'm getting … | |
I have an attachment PDF with pixel alignment. Then I have this code which assigns short integer to appropriate pixels. [CODE] void CMFC3xxDevice::prepare_data_decompress(data_package_ex &pdata) { char *input = (char*) pdata.pData; int incount=pdata.cbData; int finalarray_pos = 0; DWORD dwTempBufferSize = pdata.cbData; for(int i = 0; i < incount; i+=3) { MFC3XXPixelAlignment … | |
Hi guys, I am trying to make the Tic Tac Toe Class game but I am encountering an error with the initialization of my array for the game board. Instead of initializing everything to blank spaces, random characters end up in there and I don't know what is causing this … | |
Hey, I have to read numbers from a text file. Heres an example input: 6 8 1 2 10 1 3 9 2 3 7 2 4 2 3 5 5 4 5 3 4 6 8 5 6 4 The parser I coded works fine in NetBeans and Dev … |
The End.