49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
When checking my code with PC-LINT it advised me to make some member-functions const What is the advantage of doing this ? | |
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 … | |
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 … | |
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] … | |
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 … | |
[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; } } … | |
[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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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... | |
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 … | |
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 … | |
[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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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) { … | |
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 | |
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() { … | |
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 | |
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: … | |
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 | |
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? |
The End.