49,761 Topics

Member Avatar for
Member Avatar for botter911

Hi, I use the code below for an bitmap image and it works great. The only problem is after I use system("cls") or when the scroller goes down it cuts the image. I use compiler Dev-C++ and my OS is Windows XP and I have also vista. I was thinking …

Member Avatar for marco93
0
265
Member Avatar for apch01

cant display the correct value of the structured values with function ... is it got to do wif some buffer stuff ??? [code] #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; const int MAXCHARS = 15; const int NUMEMPS = 1; int i; struct EmpRec { long num; char …

Member Avatar for apch01
0
67
Member Avatar for fyp_mcs

i am a final year student doing a project in brain computer interface. i need to know if we can control the mouse cursor movement using c++. that is if i want to move the mouse cursor in any direction that is right left up down, of any magnitude but …

Member Avatar for Comatose
0
29
Member Avatar for daviddoria

If I use the uncommented 3 lines for getting an int out of a stringstream, the value in MPV is wrong. However, if I make a new stringstream, then it works fine. I thought setting .str("") was essentially resetting the stringstream? [code] line = ""; getline(fin, line); //get fourth line …

Member Avatar for daviddoria
0
461
Member Avatar for disc

When checking my code with PC-LINT it advised me to make some member-functions const What is the advantage of doing this ?

Member Avatar for disc
0
181
Member Avatar for Samran

Hi, I am facing a problem with allocation of two dimensional char array. The problem statement requires me to get the number of rows and columns of the array from a file. I have saved the rows in "rows" and columns in "columns", both of type int. Here is how …

Member Avatar for Samran
0
3K
Member Avatar for thingstealer

Hi everyone, How do you define two structs that include lists of or pointers to each other? I've tried including a forward declaration of one, and neither way works. Any help getting around this would be great, thanks in advance! [code=c++] // struct arc; struct node { Vector<arc> arcs; void …

Member Avatar for thingstealer
0
129
Member Avatar for mguj1130

For this program I am supposed to add two numbers together, up to 20 digits, using arrays...i have most of it working but i cant figure out how to solve the carrying over problem when the two numbers added are greater than 9....here is what i have so far [code] …

Member Avatar for vmanes
0
672
Member Avatar for vmarc29

Hi all, i made some java few time ago and i'm now studying C++ here is a simple program i've been working on to learn about it but the fact is for some days now i can't figure why it doesn't work... in fact i just want to create an …

Member Avatar for vmarc29
0
164
Member Avatar for nosnibor

[CODE=cplusplus] bool BODYTYPE::Seek(BODYTYPE * body) { string line; string key(body->style); size_t found = ' '; fstream file("..\\Data\\BODYTYPE.txt",ios::in); if (!file.is_open()) { cout << "Unable to open file \n"; return false; } file.clear(); file.seekg(0); for(;getline(file,line);) { if((found = line.find(key,0)) == 0 ) { file >> body->style >> body->doorCount; return true; } } …

Member Avatar for nosnibor
0
82
Member Avatar for bluemm87

[CODE=cplusplus] // using pointers with // const methods #include <iostream> class Rectangle { public: Rectangle(); ~Rectangle(); void SetLength(int length) { itsLength = length; } int GetLength() const { return itsLength; } void SetWidth(int width) { itsWidth = width; } int GetWidth() const { return itsWidth; } private: int itsLength; int …

Member Avatar for StuXYZ
0
160
Member Avatar for johnray31

Hi guys, I am trying to learn this fantastic language. My question is Does Structure in c++ contain default constructure and destructure. And when we allocate memory for structure by new operator like Struct special { int x; int y; }; special = new special; Then if special going to …

Member Avatar for Comatose
0
101
Member Avatar for Dendei

Hello i have an array of dates and want to input a week ex week #14 and get all the dates written out in that week. Anyone know a good way to convert weeks to dates or how i should solve this? thx for answer.

Member Avatar for Dendei
0
94
Member Avatar for Seapoe

Hi, I'm new here and need some help on beginning my program. I've read the thread on homework help and am not here asking for someone to do my program. I have an assignment which I basically have to take in polynomials from the user and add/multiply them. I decided …

Member Avatar for monkey_king
0
102
Member Avatar for fourstar

Hi all, I'm new here. Hello! I am a new comp. sci major and am required to take a beginning course which we learn c++. So far I've been hanging in, but I don't have the greatest teacher to learn from. I've had no formal programming language training. I've actually …

Member Avatar for tux4life
0
333
Member Avatar for rickster11

a percent sign? My program asks the user for a percentage rate. It then puts (with cin) the rate into a double. However...if a user tries to type a % after he enters a number...the program goes wack...

Member Avatar for tux4life
0
176
Member Avatar for Vallnerik25

I have a question regarding when to use delete to free memory used by a pointer. I have a class function that uses dynamically allocated memory and I want to properly use delete to free up the space when I am done with it. [code=c++] // Overloaded addition operator. CSimpleString …

Member Avatar for Vallnerik25
0
238
Member Avatar for dvsConcept

I'm trying to simulate the spin of a slot machines [reel1][reel2][reel3] so they look like they are in motion. i'm getting this error: Error 2 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion) [code=c++] //rotation of …

Member Avatar for dvsConcept
0
695
Member Avatar for jayli27

[code=cplusplus] #include<fstream.h> #include<stdio.h> #include<conio.h> #include<string.h> #include<iostream.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> void deposit(void); void addrecord(); void delrecord(); void modrecord(); void disprecord(); void dispall(); void withdraw(); float w,z; class account { int accountno,cls; char name[30],type; float deposit,withdraw; public: account() { deposit=withdraw=0; } int giveaccountno() { return accountno; } void getdata(int …

Member Avatar for siddhant3s
0
363
Member Avatar for VBNick

right now, I am allocating a dynamic 2D array for my rasterizer's edge list. My setup looks like this: [code="cplusplus"] struct EDGE { float x, dx; float uvws[4]; //u, v, 1/z, shade float duvws[4]; float y_limit[2]; bool active; }; struct EDGERECORD { EDGE *left_edge; EDGE *right_edge; EDGE edges[9]; UINT16 num_edges; …

Member Avatar for VBNick
0
138
Member Avatar for BruenorBH

I am creating a program in Dev-C++ v. 4.9.9.2 using Win32 API that loads from a file and saves to a string. The only issue is that I cannot split the string to the requested variables... Here is what is in the file... 08:00:00 PM, 08:00:00 PM, 08:00:00 PM, 08:00:00 …

Member Avatar for BruenorBH
0
111
Member Avatar for wrxhokie

I have a C static library that I need to link to a new DLL i'm creating. I'm using Visual Studio 2005, and created a console application that outputs a DLL. But when I try to compile I get unresolved external linker errors: Error 2 error LNK2019: unresolved external symbol …

Member Avatar for wrxhokie
0
323
Member Avatar for freddan007

Hello, I've started learning how to make simple GUI programs in cpp using theforgers tutorial. However I was going to add XP style to my program and I found a page that showed me exacly how to do it for VC++ 6. The problem when I had added the lines …

Member Avatar for freddan007
0
754
Member Avatar for ahfrey85

Hi, while doing my assignment im somehow stucked somewhere which i didnt know why and i need some help. i have jus started learning abt c++. so im jus using some basic syntax [code] #include<iostream> using namespace std; int main() { int selclass,i,position; char ch; int seats[100]={0}; //array while(true) { …

Member Avatar for ahfrey85
0
121
Member Avatar for erialclaire_238

Newbie here. i need to create a program with this output: Enter 5 values: 3 4 5 7 9 Enter a number to search: 4 4 found in location 2 Anyone who can help me on this? Tnx, Claire

Member Avatar for skatamatic
-1
97
Member Avatar for bluemm87

I'm trying to learn C++ with a book and it has this example program in it, but when i try to compile it, it comes back with error C2065: 'localVarable' : undeclared identifier. What's wrong with it? [code=cplusplus] // allocating and // deleting a pointer #include <iostream> int main() { …

Member Avatar for bluemm87
0
74
Member Avatar for risa

How can i prevent a dialog closing by Alt+F4 ? I am using PreTranslateMessage(),,,,what is the Virtual key #define for Alt+F4 or is there any other way?,,,,thank you

Member Avatar for mitrmkar
0
245
Member Avatar for crewxp

For some reason, I can't get scanf to work. I did it just like the book said. Try it. I'm supposed to enter (FirstInitial)(LastInitial)Grade Ex: TB100 For Tom Brady got a 100. It reads: FirstInitial: NOTHING LastInitial: T Grade:0 Then it skips to the second student and did this FirstInitial: …

Member Avatar for siddhant3s
0
290
Member Avatar for 10Pints

Just started using this compiler - with my old VC6 code, but it seems to think a directory is readonly when it isnt? - any ideas? this is at/after the last the line of the file compiler output: c:\data\dev\cms\3.0.0.0\code\word\src\word.cpp(220) : fatal error C1083: Cannot open include file: 'c:\data\dev\cms\3.0.0.0\code\word\src': Permission denied

Member Avatar for 10Pints
0
245
Member Avatar for serkan sendur

hi guys, i wonder if there is technically any difference between using break or return in order to quit a loop without reaching its condition?

Member Avatar for Narue
0
1K

The End.