49,761 Topics
| |
[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 … | |
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 … | |
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 … | |
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]; … | |
how would be able to display all the names a user entered. the user entered the names through a while loop | |
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 … | |
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 … | |
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 = … | |
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);} | |
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 … | |
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 … | |
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 | |
Is there any difference in c++ when freeing memory between the free method, or the delete keyword? Thanks. | |
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. … | |
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 … | |
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 << … | |
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 … | |
how to write a program that can accept a date from user and print the day on which it occurs | |
[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 … | |
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: … | |
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 … | |
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 … | |
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? | |
[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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.