49,755 Topics

Member Avatar for
Member Avatar for johans22

can i use the same handle over again in a loop?.. HANDLE fhandle; HANDLE fhandleMap int *Mem = NULL; for (loop 7 times) { fhandle = CreateFile(file, GENERIC_READ, ...); fhandleMap = CreateFileMapping(fhandle, ...); . . Mem = ...; ... // do various things } if (fhandleMap) {CloseHandle(fhandleMap);} if (fhandle) {CloseHandle(fhandle);}

Member Avatar for thelamb
0
139
Member Avatar for beejay321

Im supposed to write a program that reads in 10 c strings and will sort them alphabetically using (strcmp(list[h],list[j])>0) which basically says if list h is closer to the start of the alphabet then it is true else it is false here is my code [CODE]#include <iostream> #include <cstdlib> using …

Member Avatar for peter_budo
0
2K
Member Avatar for tehmarto

Hi all, So I got a program that I don't have source code for and want to find a function in it. I know this function is executed when I perform a specific action. What I plan to do is the following: perform this action for example 20 times, and …

Member Avatar for thelamb
0
297
Member Avatar for idrian211

write a program that utilizes looping to produce the following table of values: A A+2 A+4 A+6 3 5 7 9 6 8 10 12 9 11 13 15 12 14 16 18 15 17 19 21

Member Avatar for griswolf
0
80
Member Avatar for LevyDee

Is there any difference in c++ when freeing memory between the free method, or the delete keyword? Thanks.

Member Avatar for nndung179
0
226
Member Avatar for MasterGberry

I am making a simple card game, trying to shuffle a deck of cards that i made with a map. [CODE]std::map<int, std::string> theDeck;[/CODE] How could I go about shuffling the items in the deck? I am having issues figuring out the algorithm. This is what I tried, but didn't work. …

Member Avatar for MasterGberry
0
1K
Member Avatar for beejay321

so for my computing project we have just started to work with using input and output of text files, the tutorial my teacher gave said to include these libraries, which i did [CODE]#inclue <fstream> #include <iomanip>[/CODE] and explains how to use [CODE] ifstream fin; //fin is my file input variable …

Member Avatar for beejay321
0
325
Member Avatar for kra9853

I need help with using the rand() function and an array to create 19 random numbers when the user types 'P' instead when I type 'P' I get 19 rows of 19 numbers [CODE] int main () { char command; double setNum [19]; int create; create = 0; cout << …

Member Avatar for Ancient Dragon
0
143
Member Avatar for cantalope

I am very new to c++ and we cannot use any built in libraries yet for the following program. The program runs fine until I add a question at the end if the user wants to quit or not. If not the program will run again to compute the power …

Member Avatar for cantalope
0
4K
Member Avatar for biljith

how to write a program that can accept a date from user and print the day on which it occurs

Member Avatar for Ancient Dragon
0
101
Member Avatar for daviddoria

[QUOTE]Ov course you don't, but many people here feel that vectors are the only solution to using arrays. They love suggesting things obviously beyond your level.[/QUOTE] This is not beyond his level. There is no reason to learn arrays before vectors. Novices should learn vectors because they convey the same …

Member Avatar for vijayan121
0
80
Member Avatar for daniel1977

I need some help in tracking down a problem I am having. Attached is a zip file that has a bulk of the files used in this assignment. I am recieving a compiler error that I do not know where to look for the solution. The IDE shows the error: …

Member Avatar for daniel1977
0
159
Member Avatar for relu

Hi, I am a beginner in programing so please be patient. I am using Turbo c++ 3.0, and I can't make this little program to work...:( It should display a lightgreen square and after enter it should write a coloured text...The first part works just fine, but the second one …

0
37
Member Avatar for rem45acp

In c++, I would like to get the number of seconds from between the current time and January 1, 2000. The problem that I'm having is assigning one time struct with the current time, and another with other one. When I use difftime(), it just returns 0. There is something …

Member Avatar for Ancient Dragon
0
295
Member Avatar for kylemurray123

I'm kind of new to c++ and i wrote a simple program to convert ounces to grmas and when i had finished i was wondering if there was a user interface so i can make it look appealing?

Member Avatar for Ancient Dragon
0
133
Member Avatar for UnseenTerror

[COLOR="Green"]So I've been having long nights and extreme headaches over my program. I have my main function which is the menu. Then im adding my entrees as their own thing below that. I am pretty sure i need a function prototype or a function call or something else to fix …

Member Avatar for UnseenTerror
0
200
Member Avatar for tawes01

I want to make a program that is run when a user logs on, and after a set period of time, prompts for administrator permission to extend time limit. If there is no permission given, the program puts the computer in sleep mode and requires administrator permission to resume before …

Member Avatar for Duki
0
101
Member Avatar for Valaraukar

Hey guys, So my Maths has obviously gotten a little rusty and I seem to be struggling with what should be quite simple.... The scenario: I have lines being drawn in 3D space that are calculated using an algorithm. These lines are actually made up of multiple line segments to …

Member Avatar for jonsca
0
795
Member Avatar for hanvyj

I am writing a video program, everything works fine except I am often (ie most times, but not [I]every [/I]time) getting the following error: Unhandled exception at 0x6076fde0 (msvcr90d.dll) in javaw.exe: 0xC0000005: Access violation reading location 0x0a450020. I have tracked it down to this function: [CODE]//fill the buffer from data …

Member Avatar for hanvyj
0
5K
Member Avatar for jfunchio

I need help getting my function to overload the + operator to add a integer and a Rational object. Right now I am able to add two rational objects with my overloaded +. I made a second overloaded + function and now I am able to add an integer and …

Member Avatar for Fbody
-3
248
Member Avatar for jfunchio

I'm trying to make my program be able to add Rational objects with integers using type conversion. I've gotten it to compile but when i run it i just get a bunch of random numbers over 1 so something like this -8993458/1. My code for the conversion is. operator int(){return …

Member Avatar for dgirdhar
0
230
Member Avatar for Danny1994

Hai Programmers, my title should say it all but im looking for a function where another form (wich pops up when a button in first form gets pressed) will pop up at the top right of the first form. (Would be best with "StartPosition" "Manuel" i guess) ([B]Im using Microsoft …

Member Avatar for Ancient Dragon
0
179
Member Avatar for angelshonu11

If anyone can send a program "Which counts how many times a particular word is repeated in a file" using File Handling... E-mail: <EMAIL SNIPPED>

Member Avatar for Moschops
-4
93
Member Avatar for airerdem

Hi everybody, What I did is, I have 2 one dimensional vector which are inside structure. [CODE]int numberofactivities; struct PopL{ vector<double> RK; //For Random Key }; //Random keys for left population vector<PopL> PopL(3); srand((unsigned)time(NULL)); for (int j=0; j<3; j++){ for (int i=0; i<numberofactivities;++i) { rn=((double) rand() / (RAND_MAX+1)) ; PopL[j].RK.push_back(rn); …

Member Avatar for Fbody
0
173
Member Avatar for ViXXeY

struct node { char str[10]; int val; node *next; }; void main() { clrscr(); node *head=NULL;int cnt=0; cout<<"Continue... [Y/N]";char ch;cin>>ch; while(ch!='n') { node *temp; cout<<"Str= ";cin>>temp->str; cout<<"val= ";cin>>temp->val; temp->next=head; head=temp; cnt++; cout<<"Continue... [Y/N]";cin>>ch; } node *temp1; temp1=head; while(temp1!=NULL) { cout<<temp1->str<<" "; cout<<temp1->val<<endl; temp1=temp1->next; } getch(); } Plz help me out....... …

Member Avatar for daviddoria
0
116
Member Avatar for DARKSUPR3MACY

Hello, I am new to this site, as well as to C++. I was hoping someone could help me out with my program, I was hoping to incorporate an if, else statement which we have yet to go over to see if I can. I have basic experience in java …

Member Avatar for Fbody
0
172
Member Avatar for KunalPatel

Hello, I'm a newbie to Objective-C & iPhone development, hence please bear with[ICODE][/ICODE] me. I'm working on an app which loads with UITableView and upon selecting one particular cell called "Address Book" it should load with another UITableView containing all the addresses retrieved from a web request. Using NSXMLParser's delegate …

Member Avatar for KunalPatel
0
150
Member Avatar for Jonellys

Hello! I'm new here... and I'm having trouble trying to download and upload files from an ftp server.... Btw this is not for homework! I'm trying to help a professor with this but I'm stuck!... Help?? :/

Member Avatar for Moschops
0
171
Member Avatar for hq1

Hello. I'm supposed to store the two numbers in two int arrays of size 30, one digit per array element. If the number is less than 30 in length, enter enough leading zeroes (to the left) to make number 30 digits long. I will need a loop to add the …

Member Avatar for danb737
0
1K
Member Avatar for AnkitPasi

Hello. The problem with the following code is that when I read from a file after restarting the program and then try to display the contents, it goes into an endless loop. I hope that someone can point out the logical error hiding there. [CODE]#include <iostream> #include <windows.h> #include <fstream> …

Member Avatar for thelamb
0
323

The End.