49,761 Topics
| |
I'm having a few issues with my Pig Latin program. First, The program doesn't loop correctly. I need it to keep prompting the user for input until the user presses CTRL+D, but I can't figure out how. Right now, it never re-writes the line "Enter some text (CTRL-D to end):". … | |
String is an object, but it can be initialize without (), like [CODE]string str;[/CODE] However if I define a user defined object, I must initialize it like: [CODE]myclass myobj(); [/CODE] How is it possibel to not use: () ? | |
This question has largely already been posted, and I apologize for that. However, I cannot get the max an min values to change from anything except -1. I'd love to make them actually work; I feel like the comparison statements are correct. I know the counter is working properly, and … | |
An integer is said to be prime, if it is divisible by only 1 and itself. For example, 2,3,5 and 7 are prime, but 4,6,8 and 9 are not. Write a function that determines whether a number is prime. Use this function in a program that determines and prints all … | |
Hello guys, i need help. I just began to learn c++, and i have a problem. How to write a program, which count numbers in a interval from k to n. I now the program is simple but i just can t bring it to work. Im using the loop … | |
Hi, I have the following piece of code. I do the following here 1)open a file. 2) Print the filepointer positon . I get 0 3)Read the file in a while loop till i reach the end 4)close the file 5)Open the same file 6) Print the file pointer position … | |
Required to use PriorityQueue to implements Dijkstra’s algorithm for solving the single-source shortest-path problem for weighted graphs without negative edge weights. I have a wrong output of my program. Here's the code: [CODE] //Graph.h class Graph { public: Graph(int r = 1, int c = 1); // constructor void setCost(int … | |
Hello to all ! i am encoding a class about rational numbers, holding the numerator and a denominator and all operators like are overloaded for it..it works all so fine ecxept for one wierd point: my cast-to-double operator is called at the times it is not called at all..for example … | |
This is the first time I have done this, I hope I am doing it correctly. If not, guide me toward proper etiquette. I am a beginner, intro C++. I received a message from the compiler that I don't know how to fix. My question is where is the error?, … | |
Hail. I'm having trouble with this program...here is the discription... Description: Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values. The program should read in an arbitrary number of integers that are in the range 1 … | |
Hi Would any one tell me how can I generate a random permutation of N numbers in c++? Is there any algorithm in STL for this purpose? Thanks in advance | |
Hi guys, I would like to convert a string date into seconds using only the standard library. The date format is like this: Wed Dec 02 12:23:09 +0000 2009 and I would like to convert it to seconds. Is it possible to just use only the standard library? | |
Ok, so I need a little bit of help with a program i'm writing. Let me give you the details. The user is suppose to enter two sentences with all lower case letters and have the first letter of each sentence become capitalized. Here is the code so far:[CODE] // … | |
Hi guys, I am working on progamm about reading some words in MySQL then display the results during run time command.But my code keep giving some MySQL errors about I can't read it. Am I making some mistakes with sequence? I am pretty new in C++. [code=cplusplus] //---------------here is code … | |
Hi, I'm having trouble with getting my cuda program to work, apparently it is something to do with the way I call the kernel and what I'm telling it to do compare to what I want it to do. OK, what I want it to do is (for now): *input … | |
How can i sort a vector which has strings and while sorting it to change data simultaneously in 2 other vectors? eg. vector 1 vector 2 vector 3 NewYork 25 1935 Athens 43 1990 I want it to be like this: Athens 43 1990 NewYork 25 1935 I want to … | |
Consider two classes, PersonClass and LawyerClass. If LawyerClass derives from PersonClass, you can create a PersonClass* as a LawyerClass, like [code] PersonClass* Person = new LawyerClass; [/code] then you can convert it to a LawyerClass* with [code] LawyerClass* Lawyer = static_cast<LawyerClass*>(Person); [/code] However, if you don't know that the person … | |
Hi :) I was trying to find the max length in my multimap. here is how I define it: [CODE]multimap<int, string> mm; multimap<int,string>::iterator it; mm.insert(pair<int, string>(some_int, myvalues));[/CODE] Now the main part that I want to discuss is this. I have created 2 functions to find the size of records in … | |
I am writing a program that can read in statistics from a basketball team. The file lookes like this: Joe 3 114 9-19 1-3 2-4 3 15 4 2 1 2 3 21 I have created an array of structs to read all of them in I used ifsteam infile2("file.txt") … | |
Hay Everyone i'm a new member of this fantastic fourm , and i have some problems with programs i'm really stuck with:'( , so guys i really appreciate any one who can help me with anything, and here is the problem , Write a program using a set of functions … | |
Hi , I want a C++ implementation for a LR parser example from this book: Concepts of Programming Languages, 8/E - Robert W. Sebesta here is the example .pdf: [url]http://www.spelman.edu/~compsci/cis346/lecture3_cis346_Chapter4.pdf[/url] its begin from page 6 .. please help me .. thanks .::. Sultan .. | |
I'm making a text-based RPG (Sure you haven't heard that one before ;)) So I'm trying to randomize the damage that the player deals. I want the damage to be (strength*2) + a random number between the variables mindamage and maxdamage, how do I do that? | |
I can't figure out, or google how to do this =/ I just need something to put my computer to sleep [CODE="cplusplus"] #pragma comment (lib, "PowrProf.lib") #include "stdafx.h" #include "windows.h" #include "Powrprof.h" int _tmain(int argc, _TCHAR* argv[]) { SetSuspendState(false, false, false); return 0; } [/CODE] I get this error: 1>Sleeper.obj … | |
I was wondering if theres anywhere to get C++. You see i have work to do for homework and i'm trying to do it at home but it's quite hard to do without the program. Is there any free or trial software that can help check my code for ...lets … | |
Hi everyone. I am creating a small windows form application using Visual C++; and I would need to delay a loop by a second. Sleep() doesn't work.(Not sure why) Is there a way I can use the timer? Any suggestions on how can I do that? Thanks in advance. :) | |
Hi there, I'm doing a camera caliberation program which will detect whether there is stain on the camera lens. i have a program that can detect the stain and display but how do i go about detecting the position and also CIRCLE the position whereby there is stain. any suggestion? … | |
i really need help!!! i am a noob, just getting started in c++ and i need help sorting my array. please don't suggest me std::sort because i don't really know how to use those! sorry i am such a noob, but i prefer it the simplest way possible please help … | |
Here is the LinkedList.h file: [CODE]// LinkedList.h -- class for a linked list as a data structure template <class DataType> struct Node { DataType info; Node<DataType> *next; }; // LinkedList maintains a current position in list after each function call // If an object of a struct is used for … | |
I keep getting a Segmentation fault error when i run my program, i read that this is an error with memory or somthing, i was hoping someone could point out where the problem in my program is. My code is below. [CODE] #include <iostream> #include <vector> using namespace std; class … | |
would someone help me learn stl ? i am new to c++ and i am learning myself so its getting very hard to understand...... thanx everyone in advance.... |
The End.