49,761 Topics

Member Avatar for
Member Avatar for Zvjezdan23

[CODE]#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; string reverseStr(string& x); int main() { // Array for your words vector<string> words; // Your Words words.push_back("I"); words.push_back("won"); words.push_back("ten"); words.push_back("tickets"); words.push_back("for"); words.push_back("a"); words.push_back("rock"); words.push_back("concert"); words.push_back("in"); words.push_back("the"); words.push_back("park"); words.push_back("for"); words.push_back("this"); words.push_back("Friday"); vector<string>:: iterator myIter; vector<string>:: const_iterator iter; cout << "Sentence …

Member Avatar for Zvjezdan23
0
181
Member Avatar for bfprii

So recently I've just started out working with named pipes/pipes. As of right now I have a process called y2 on my local computer. That is the server process. I am trying to connect to that server by opening a pipe. However the WaitNamedPipe function is hanging, apparently the CC …

Member Avatar for bfprii
0
76
Member Avatar for realproskater

here is the question: Write a program that reads names and gpa’s from a text file. The file looks like: James 3.9 Margaret 3.5 Charles 1.2 Jennifer 4.0 Your program sorts the students ascending by gpa, and prints the sorted list including names. To keep the names with the numbers …

Member Avatar for realproskater
0
236
Member Avatar for pucivogel

Can anyone help me out.I can't understand why am i getting this kind of error [CODE]#include <iostream> #include <string> #include<sstream> #include<iomanip> using namespace std; void getDerivative() (double [],int[]); void print_d_Array (double[]); void print_i_Array (int []); int main () { const int polynomsize=5; string sub[polynomsize]; string coefficient[polynomsize]; string exponent[polynomsize]; double coefdouble[polynomsize]; …

Member Avatar for alaa sam
0
146
Member Avatar for Mayank23

how would be able to display all the names a user entered. the user entered the names through a while loop

Member Avatar for alaa sam
0
106
Member Avatar for Asif_NSU

i will be given a set of any length and my program will have to produce the power set. For example: input: c d e output: empty c d e cd de ce cde total number of subsets: 2^3 = 8 I will try to write my own code, but …

Member Avatar for elemes
0
1K
Member Avatar for cantalope

Hi, I'm currently in college working on a degree in Information Security Systems. I am taking a C++ course as a pre-requisite, although it will be the only programming course I have to take. I found this site while trying to resolve a small problem in my code I was …

Member Avatar for AndreRet
0
116
Member Avatar for johans22

is it possible to create array of pointers and set + get its elements using a class like this?. make changes/add to the class as needed. show actual code, if possible. [CODE]class t { t::t() { } t::~t() { free(array); array = NULL; } void set_size(int s) { array = …

Member Avatar for Fbody
0
148
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
304
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
227
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
327
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
102
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
160
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
316
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
201
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
102
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
803
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
180

The End.