49,757 Topics

Member Avatar for
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
264
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
448
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
163
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
129
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
176
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
Member Avatar for veroniclake

Hi All, I am facing a serious problem. I need help! There are cases for QueryInterface method in MSDN one amoung them is, a call to QueryInterface for a pointer to a specified interface succeeds the first time, it must succeed again, and if it fails the first time, it …

Member Avatar for Frederick2
0
117
Member Avatar for hgftechhead

Hi All, I have an assignment that asks : Write a program that prompts the user for test scores (doubles). The user enters -1 to stop the entry. After all of the test scores have been entered, calculate the average, the highest and the lowest test score. Use the code …

Member Avatar for jomanlk
0
133
Member Avatar for simonsayz27

I'm writing a program that builds a graph and detects articulation points. I'm stuck with the root vertex and how to find out if it is an articulation point. By definition it is iff it has more than one child but for example: [CODE] 0---1 |\ | | \| 2---3 …

0
51
Member Avatar for vinochick

I have most of the program written, but I'm stuck on the 2 dimensional array. Here is the code I have so far: [CODE]#include <iostream> using namespace std; //function prototype int calcTotal(); int main() { //declare variable and array int total = 0; int sales[6][2] = {{12000, 10000}, {45000, 56000}, …

Member Avatar for vinochick
0
112
Member Avatar for xcorpionxting

I'm working on a small C++ project that requires using classes. I'm supposed to create a super class Animal and the sub classes Fish, Bird and Insect. In the main function, the object of type animal is created. I need that object to 'become' one of the 3 other types …

Member Avatar for xcorpionxting
0
197

The End.