49,761 Topics
| |
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: … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
how i move the mouse cursor . and create left, right and double cliks using visual c++ i m new to visual c++ | |
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? :( | |
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 >> … | |
| 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". … |
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 … | |
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 … | |
| 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 … |
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 … | |
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 … | |
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. | |
bool operator >(Counter & rhs) { } bool operator ==(Counter & rhs) { } bool operator !=(Counter & rhs) | |
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 - … | |
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 … | |
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> | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 { … | |
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. | |
[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 … | |
[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 … |
The End.