49,761 Topics

Member Avatar for
Member Avatar for PSP1202

Hey all I'm having trouble with loops again and this time it is for loops. I need to calculate monthly balance and interest paid on a balloon mortgage and am having trouble with the calculations. An example of what the program should look like: Enter Mortgage: 100000 Enter Interest Rate: …

Member Avatar for WaltP
0
110
Member Avatar for IndianaRonaldo

Hi all, I am just going through C++ basics now and I read that enum types cannot be input directly with cout and cin and such.And also that type coercion from int to enum is not allowed.But when i do this, [CODE] enum SumEnum{ENUM1,ENUM2,ENUM3} SumEnum VarEnum; scanf("%d",&VarEnum); printf("%d",VarEnum); [/CODE] It …

Member Avatar for Tumlee
0
1K
Member Avatar for lelejau

I have this code to take a screenshot of my app window: [CODE] BOOL TakeScreenshot() { struct tagPOINT Point; struct _SYSTEMTIME SystemTime; HWND handle = (HWND)WINDOW_HANDLE; if(handle) { CreateDirectoryA("Capture",0); RECT r; GetClientRect(handle,&r); Point.x = r.left; Point.y = r.top; ClientToScreen(handle,&Point); OffsetRect(&r,Point.x,Point.y); HDC cr = CreateDCA("DISPLAY",0,0,0); HDC cr1 = CreateCompatibleDC(cr); HBITMAP ho …

0
70
Member Avatar for pendo826

Hi need some help. I dont really know much about classes and objects and i dont understand tutorials and i want to make it that when a user picks up objects it will be added to an inventory that i have set up and also when the inentory is full …

0
62
Member Avatar for grimreaperx2

Ok I have been working on this program for some time now. The program is to take any number of any size and then add them together. After which it will print out the result. The problem I am having is that the gut of the add function seems to …

Member Avatar for aramil daern
0
111
Member Avatar for vict1

I want to write a C++ class, like this: In MyClass.h: [CODE]class CMyClass { public: CMyClass(); int MyFun(int a, int b); protected: int m_iData; BOOL m_bFlag; }[/CODE] In MyClass.cpp [CODE]CMyClass::CMyClass() { // Some initialization codes } int CMyClass::MyFun(int a, int b) { // Implemenation of MyFun }[/CODE] Now I want …

Member Avatar for vijayan121
0
155
Member Avatar for GatorProgrammer

As the title suggest this is about problems I have having with writing my Caesar Cipher. I know how they work but I don't know exactly how to write it. And I know that many of you are wondering why I just don't read the hundreds of other Caesar Cipher …

Member Avatar for Satyrn
0
122
Member Avatar for asif123

how i move the mouse cursor . and create left, right and double cliks using visual c++ i m new to visual c++

Member Avatar for Narue
0
144
Member Avatar for TheChosen0ne

My exe requires a dll to run, I have to keep moving the dll to the exe's folder to run it properly :( How can I combine the 2 files together as one? :(

Member Avatar for Stefano Mtangoo
0
149
Member Avatar for ben1996123

I've never had a problem with files before, but now I can't seem to get it to work properly. I have this code: [CODE] fstream someFile("file.txt"); switch(choice){ case 1: cout << "Enter date: "; cin >> date2; cout << "Month: "; cin >> month2; cout << "Year: "; cin >> …

Member Avatar for WaltP
0
135
Member Avatar for philipghu

Hi everyone, I just switched from Java to C++ and not so familiar with memory management in C++. I dynamically allocated an array which holds F_HeapNode objects. Whenever I assigned a value to the element of this array, I got an error message saying" no operator = matched these operands". …

Member Avatar for philipghu
0
170
Member Avatar for infantheartlyje

HI folks, This is my code. How can i pass a outside structure parameter to a class method? [CODE]using namespace std; struct status { char name[80]; double balance; unsigned long account_num; }; class FileHandler { public: FileHandler(string); ~FileHandler(); int getRecords(struct status *); int putRecords(struct status *); private: string fileName; fstream …

Member Avatar for raptr_dflo
0
172
Member Avatar for ronak127

hey guys I'm a newb to this C++ programming and I need help. I've made a non-recursive GCD C++ code, but i was having problems with the algorithm. Can someone help please? [ICODE]import java.util.Scanner; public class GCD { public static int GCD; public static int div; public static int remainder …

Member Avatar for mrnutty
0
176
Member Avatar for HASHMI007

Assume the following specification of a node of linked structure and the class [CODE]// LinkedStructure And the class.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<stdio.h> #include<stdlib.h> #include<conio.h> using namespace std; struct Node{ int info; struct Node *next; }; typedef struct Node * NODEPTR …

Member Avatar for raptr_dflo
0
97
Member Avatar for mikkey91

Hi! :) I've been given a task in which I have to code a C++ program where an encryption key string with a length of 26 small alphabet is asked, then the user must input a word to encrypt and then it shows the encrypted word. If the encryption key …

Member Avatar for raptr_dflo
0
213
Member Avatar for fox196

Hi, I'm getting segmentation fault errors when I use quicksort with ~350 000+ numbers. This is the quick sort algorithm I'm using: [CODE]void swap(int* v, int i, int j) { int tmp = v[i]; v[i] = v[j]; v[j] = tmp; } int partition(int *v, int s, int e) { int …

Member Avatar for raptr_dflo
0
1K
Member Avatar for SoftwareGuy

Hi. I'm sure this question has been asked before, but I can't get the text searched for. If anyone can explain them, refer me to an article, or give me the correct search query I would appreciate it. Thanks.

Member Avatar for SoftwareGuy
0
235
Member Avatar for johnnyboyslim
Member Avatar for johnnyboyslim
0
105
Member Avatar for aFg3

Ok I just need an idea or a source code to start my project. I need to read a text file with fstream or any other thing. This will be my txt file (nothing the same, just an example) [CODE]a = 6 b = 3 c = 7 a - …

Member Avatar for Narue
0
190
Member Avatar for eriger777

Hello, I'm trying to compile my client, For a video game. But I get this error [CODE]c:\drsource stuff\46022362clientlatest\clientlatest\filemgr.h(18) : error C2275: 'std::iterator' : illegal use of this type as an expression [/CODE] [CODE]{ typedef map<int, T*> hash; typedef map<int, int> check; typedef map<int, T*>::iterator index;[/CODE] And here is another one …

Member Avatar for raptr_dflo
0
364
Member Avatar for lelejau

I have already downloaded the latest DX SDK (June 2010) and still, this error remains. error C2065: 'IID_IDirect3D3' : undeclared identifier I already included the headers below but it seems not to work, what am I missing? #include <d3d9.h> #include <ddraw.h>

Member Avatar for lelejau
0
205
Member Avatar for cummings15

I am trying to get my code below to display what high school the students are from from the .txt file the text file below will work but i want to add school to txt file and confused on what to change in my code [QUOTE]Alphy Beta 85 83 77 …

Member Avatar for raptr_dflo
0
147
Member Avatar for New4lyfe

Consider the following selection statement where X is an integer test score between 0 and 100 Declare X as an integer Write “Please enter a number between 0 and 100.” Input X If (0 <= X and X < 49) Write "You fail" Else If (50 <= X and X …

Member Avatar for New4lyfe
0
184
Member Avatar for Majestics

SOrry guys to disturb you all... I just need a little help , can some one please give me a brief introduction to pointer... also i have some question, what does these mean [code] int i; cout<<i (mean to print i) cout<<*i (what does it mean) cout<<**i (what does this …

Member Avatar for Narue
0
116
Member Avatar for TheChosen0ne

I'm using DevC++ with the allegro library Everytime I try to run my program I always get an error saying "alleg42.dll is not found"? What am I doing wrong?

Member Avatar for Ancient Dragon
0
70
Member Avatar for Panathinaikos22

Who will spend little time to Create a guide about [code] HWND hw = CreateWindowEx( params ) [/code] in C/C++ That i want is a guide were you will have examples for all controls (Ritchtb, tb, button, tree, nodes, Listview, contextmenu, toolstrip menu, label... etc) PS: as i know CreateWindowEx …

Member Avatar for Ancient Dragon
0
167
Member Avatar for cypherscouter13

I am trying to create a vector of objects that can have pointers to functions. I would appreciate some help with this as I don't really know what to do [CODE]#include <stdlib.h> #include <windows.h> #include <ctime> #include <cstdlib> #include <iostream> #include <vector> #include <string> using namespace std; class Card { …

Member Avatar for raptr_dflo
0
195
Member Avatar for Duki

Hey everyone, Anyone know if Solaris, by default, throws an out of memory exception when 'new' is called but the system has run out of memory? I know Windows systems has this turned on by default, and AIX doesn't. But I can't find anything related to Solaris.

0
75
Member Avatar for #blessy#

[CODE=c++]#include<iostream> #include<fstream> #include<string> #include<ctime> #include<conio.h> using namespace std; class log_on{ public: void displaylogtime(); }; void log_on::displaylogtime(){ char d [9]; char w [9]; _strdate(d); _strtime(w); cout<<"\nThe current time :"<<w; cout<<"\nThe current Date :"<<d; } class clothes_selector{ string happy; string sick; string confused; string sexy; string grumpy; string winter; string summer; string …

Member Avatar for MonsieurPointer
0
109
Member Avatar for nchy13

[COLOR="Red"][B]this is what compiler shows[/B][/COLOR] tree.cpp: In member function ‘void redblacktree<T>::insert(T) [with T = int]’: tree.cpp:187:12: instantiated from here tree.cpp:103:9: error: lvalue required as left operand of assignment tree.cpp:140:9: error: lvalue required as left operand of assignment [COLOR="Red"][B]if u don't want 2 go thru' d code then kindly just tell …

Member Avatar for Narue
0
576

The End.