49,761 Topics

Member Avatar for
Member Avatar for Towely

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):". …

Member Avatar for Towely
0
178
Member Avatar for merse

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: () ?

Member Avatar for mrnutty
0
98
Member Avatar for calypso&noname

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 …

Member Avatar for calypso&noname
0
122
Member Avatar for Mclovin1234

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 …

Member Avatar for mrnutty
0
94
Member Avatar for Dex02

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 …

Member Avatar for Dex02
0
110
Member Avatar for samarth

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 …

Member Avatar for gastonci
0
269
Member Avatar for ericcool

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 …

Member Avatar for ericcool
0
143
Member Avatar for Mahsa_C++

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 …

Member Avatar for Mahsa_C++
0
449
Member Avatar for ssheck1034

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?, …

Member Avatar for Narue
1
65
Member Avatar for tennisshoes

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 …

Member Avatar for Narue
0
449
Member Avatar for hamidvosugh

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

Member Avatar for hamidvosugh
0
205
Member Avatar for toddtay

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?

Member Avatar for dyadak
0
90
Member Avatar for Bemani_lover

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] // …

Member Avatar for Bemani_lover
0
176
Member Avatar for qk00001

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 …

Member Avatar for qk00001
0
164
Member Avatar for kenny1989

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 …

0
61
Member Avatar for kavourdoukos

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 …

Member Avatar for pecet
0
91
Member Avatar for daviddoria

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 …

Member Avatar for daviddoria
0
5K
Member Avatar for Web_Sailor

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 …

0
55
Member Avatar for tasky23

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") …

Member Avatar for jonsca
1
131
Member Avatar for TYGA

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 …

Member Avatar for kvprajapati
0
133
Member Avatar for THE Robot

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 ..

0
57
Member Avatar for DawnOfIkaros

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?

Member Avatar for DawnOfIkaros
0
64
Member Avatar for VBNick

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 …

0
65
Member Avatar for thehivetyrant

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 …

Member Avatar for hajiakhundov
0
74
Member Avatar for hajiakhundov

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. :)

Member Avatar for hajiakhundov
0
134
Member Avatar for facadie

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? …

Member Avatar for Nick Evan
0
91
Member Avatar for mymyzzz

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 …

Member Avatar for Nick Evan
0
103
Member Avatar for windermere

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 …

Member Avatar for bamcclur
0
180
Member Avatar for Jfunch

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 …

Member Avatar for pecet
0
244
Member Avatar for govindak

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....

Member Avatar for govindak
0
77

The End.