49,757 Topics

Member Avatar for
Member Avatar for hurbano

so i wrote this small piece of code. it simply waits for the user to enter a command, and then, depending on the command, a different message appears. when i enter the simple words like debug and execute, it does what i want it to do. now, when i try …

Member Avatar for Vllinator
0
74
Member Avatar for liran ritkop

Hi I want to build some objects that have a little difference between them. But i wonder how would i do it - 1. build a class with some variables and build objects out of him, or - 2.build class for each object, with the functions dedicated to this 'only …

Member Avatar for mike_2000_17
0
125
Member Avatar for winnie89

I'm trying to write a code for class and after compiling the first half with g++, just make sure it'd work so far, I get all these errors. After looking them all up I don't understand why i'm getting these errors or how to fix them. If anyone could please …

Member Avatar for mitrmkar
0
209
Member Avatar for Borkoff

Hi everybody! I must make program in c++ that reads unknown number of words from a text file to char arr which after that i will have to sort the words by the first letter by alphabet in a stack. can any body help me please? txt file: den rock …

Member Avatar for Borkoff
0
148
Member Avatar for notmasteryet

i m in A csc class in college. And everytime the prof. Gives a lab i have a hard time starting it i always neeed some classmate to help me start it ... Any ideas on how i should approach the labs

Member Avatar for Fbody
0
305
Member Avatar for Arthas

I have been trying to build POCO library for few days but i have been unable to. When I try to build the foundation library from my vc++2008(i have windows 7) it gives the following error: >>>>>>>>>>>>>>> Performing Custom Build Step Project : error PRJ0003 : Error spawning 'cmd.exe'. Project …

Member Avatar for Arthas
0
5K
Member Avatar for Alochai

[CODE]/* Name: Copyright: Author: Date: 14/09/10 21:17 Description: */ #include<iostream> #include<istream> #include<ostream> #include<string> int c_f_fraction(); int c_f_decimal(); int c_f_percent(); int convert_to(); int convert(); int help(); std::string convert_code(""); float c_f_fraction_1(0); float c_f_fraction_2(0); float c_f_result(0); float c_f_decimal_1(0); float c_f_percent_1(0); int help_code(0); int main() { std::cout << "\nWhich would you like to convert, …

Member Avatar for Alochai
0
1K
Member Avatar for DaCaj

I am getting this error when trying to use a constant defined in a class in one file as an array size in a different file. I am using MSVC 2008. Here is my code. .h: [CODE] #ifndef GLOBALS_H #define GLOBALS_H #include "stdafx.h" class GlobalVars { public: GlobalVars(); static const …

Member Avatar for vidit_X
0
628
Member Avatar for GDICommander

Hi, everyone! I'm in search of an associative container that does not need an implementation of operator< for the key type. std::map and std::set requires that, so I think that I need another kind of associative container. I can always implement my own contained using a vector of pairs, but …

Member Avatar for GDICommander
0
99
Member Avatar for nbaztec

Consider the following code: [code] const int con = 100; int &ref1 = 10; //Where is this 10 stored? int &ref2 = con; ref1 = 20; ref2 = 90; cout<<ref1<<con<<ref2; [/code] This outputs: 20 100 90 My only queries are: a) Where is the hard coded number 10 stored? b) …

Member Avatar for Fbody
0
116
Member Avatar for manykanta

Friendz Please help me out. I want to write a program that can open a program, whose .exe file is stored in my desktop at a particular location.

Member Avatar for daviddoria
0
43
Member Avatar for aviavyne

Recently I was assigned to create a program driven by a main menu, followed by a submenu, followed by functions. Below is an attempt of mine, which does display the main menu, and from there a user must enter a value to proceed to a second menu, however it doesn't …

Member Avatar for Fbody
0
309
Member Avatar for rahul.pmna

Hey, I'm a beginner in C++.. I know the basics.. I want to learn more about it.. Can u please tell me how to use 2d pointers in C++.. If possible just give me a simple program which can read & display a matrix.. :)

Member Avatar for sundip
0
106
Member Avatar for Syrne

So I'm looking to create a function that prompts the user to enter 'Y' for "Yes restart the program" and 'N' for No, do not restart. I know this should use the boolean operator, I'm just unsure as to how to implement it. I also know to encase the body …

Member Avatar for Syrne
0
7K
Member Avatar for manaila

Hi, The following code is for traversing the linked list: [I]node[/I] is a [I]structure[/I] and [I]next[/I] is a pointer to next node declared in [I]node.[/I] [I]start[/I] is the pointer to the first node. [CODE] node* temp = start; while(temp != NULL) temp = temp->next; [/CODE] I dont understand the statement …

Member Avatar for manaila
0
99
Member Avatar for Eagles36

This is the code for a fractions program that is to add and subtract(i know it does not subtract yet) I am having error messages that I dont understand. [CODE]// File Fraction.h #ifndef FRACTION_H #define hbg_cmpsc122 #include <iostream> using namespace std; namespace hbg_cmpsc122 { class Fraction { private: int num; …

Member Avatar for StuXYZ
0
172
Member Avatar for codergal

I am going through my C++ class assignments and Iam trying to figure out what the programs I wrote can do. This is one about arrays. Please explain under what circumstances I can use this. Thanks. // arrays_accessing using for loops.cpp : Defines the entry point for the console application. …

Member Avatar for StuXYZ
0
163
Member Avatar for jos_t_tarigan

hi, im trying to read and write an array of integer to/from a file. i use this to write to a file: [code=c]fwrite(texel, sizeof(int), size, fp);[/code] and this to write it: [code=c] (*out) = new int[size]; fread((*out), sizeof(int), size, fp); [/code] but the data read from the same file is …

Member Avatar for Ancient Dragon
0
204
Member Avatar for qtbugfrmmo

[CODE]#include <iostream> #include <iomanip> using namespace std; void StartUp(void); void WrapUp(void); char ProgramName[] = "Assignment_3.cpp"; //Used to hold the program name void sentenceOne (); void wordOne (); void wordTwo (); void wordThree (); void wordFour (); void wordFive (); void wordSix (); void wordSeven (); void wordEight (); void sentenceTwo …

Member Avatar for qtbugfrmmo
0
147
Member Avatar for pa_bruce_fan

Receiving error when compiling invalid operands of types `double[100]' and `double[100]' to binary `operator*' The code looks like as follows. Trying to submit for homework this evening, and I'm stuck!!! #include <cstdlib> #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main(int argc, char *argv[]) { double employeeSalaryRaises[100]; double …

Member Avatar for Akill10
0
114
Member Avatar for Nandomo

I am doing this silly program as practice but am having problems with the condition in the if loop... Please help me. The condition after the color question goes directly to its condition without accepting an answer. [CODE]// Add directories #include <cstdlib> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> …

Member Avatar for Nandomo
0
124
Member Avatar for Exercitus

Hello, I have a program assignment that is supposed to that converts decimal numbers to binary, hexadecimal, and BCD. I am having an issue with keep the leading zeros on the binary. I have used a recursive function to output a binary conversion. [CODE]#include <iostream> #include <iomanip> using namespace std; …

Member Avatar for daviddoria
0
358
Member Avatar for Win Myat

I have a promblem with following case : i have a properties.txt that included: 10 Napier St. Palm Cove 350000 47 Darkien Cl. Smithfield Heights 265000 i want to write: On start-up, the program is to prompt the user for the property listings filename (the sample file provided is called …

Member Avatar for Dazaa
0
7K
Member Avatar for Dazaa

Hi, I want to fill an array with enum Values but using integers in a loop. My set method accepts Enum types and not integers. But when I work with the enums I can use 0,1,2,3 etc. I am trying to fill a deck of cards using some loops. Is …

Member Avatar for Dazaa
0
1K
Member Avatar for sera1989

Hi everyone. I'm a bit of a noob at C++, I took the first level of this class 2 years ago and I'm tying to remember everything. I'm having a problem with a program I'm trying to write. I need to average the grades of each student and then print …

Member Avatar for Fbody
0
176
Member Avatar for .:Pudge:.

I am required to generate "n" random numbers of which each random number ranges from -10,000,000 to 10,000,000. I tried using rand() and changing the range, but it only has a max range of 32,000 or so. What is a good function or algorithm that I could use to achieve …

Member Avatar for StuXYZ
0
378
Member Avatar for 1o0oBhP

The RLE (Run length encoding) compression method compresses a file by writing repeated data as a byte containing the length, then a byte of the data itself. The 'real' RLE method involves writing control bytes. The first bit says whether the following data is compressed or uncompressed. The remaining bits …

Member Avatar for Thokozani
1
2K
Member Avatar for apautz22

I'm having a problem with my code. I am doing [URL="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=951"]Where's Waldorf[/URL] on the UVA site. I understand how I want to tackle this project, but am unable to get past a seg fault. My strategy is to pass the multi-dimensional char array of the search board to a function …

Member Avatar for apautz22
0
882
Member Avatar for itiwcsingkaww

[CODE]please help me in doing my project in one of my subject in college. it is all about getting the GCD of fractions... can anyone tell me the logic or the formula for getting it? tnxx in advance[/CODE]

Member Avatar for nbaztec
0
190
Member Avatar for Talguy

I am trying to boost the performance of the startup of my realtime application. I have the interfaces laided out in a xml file that are parsed in and created into a data structure. Would it be worth while for me to struture my program so that once the interface …

Member Avatar for Talguy
0
82

The End.