49,761 Topics

Member Avatar for
Member Avatar for Taino

Hi, I have just completed this small cafeteria program. I do have an issue I hope you can advise me with. Here is my question. 1) On the [COLOR="Green"]// Display the contents of the array[/COLOR] output I wish to have the numbers as well as the asterisks representation of that …

Member Avatar for Taino
0
120
Member Avatar for v3ga

I just started on SPOJ. It tests by redirecting standard input and output to files. Is there a way to do that directly from the terminal instead of modifying the program.

Member Avatar for v3ga
0
212
Member Avatar for MugANDGlass

[CODE]void insert() { counter++; char id [12]; string title; string author; int year; char num_id[12]; borrow *newptr,*p,*q;//declare p = head; q = NULL; //counter++; newptr = new borrow;//declare cout<<"\nEnter your ID: "; cin>>newptr->id; cout<<"\nTitle of the book: "; cin>>newptr->title; getline (cin, newptr->title); cout<<"\nAuthor: "; cin>>newptr->author; getline (cin, newptr->author); cout<<"\nYear: "; …

Member Avatar for Lerner
0
154
Member Avatar for tformed

I have created a program without using sqrt and the pwr function but instead have used logs and exponent. The professor said that math.h is not allowed. I am aware that this library is important for computation, but how do I compute the math without using the math.h? Would I …

Member Avatar for mikrosfoititis
0
1K
Member Avatar for Rebecca_t
Member Avatar for alvin_aldrich

Hi I need help on converting the sample c++ code. Can someone please help. Any help would be greatly appreciated. :D struct sample { int type; long arg1, arg2; }; struct sample sampletable[2][3] = {{{ 1, 0, 0 }, { 2, 0, 0 }, { 1, 0, 0 }}, {{ …

Member Avatar for Sten Ove Larvin
0
435
Member Avatar for stamatt45

[I]To make it easier to read, only the relevant code is below, and due to circumstances beyond my control im stuck using Xcode for the next week or so (hate this debugger).[/I] I need help fixing a seg_fault in my current program. It occurs the last time "buildPaths" is called. …

Member Avatar for stamatt45
0
222
Member Avatar for Nawaf15

Hi Everyone, I have this final assignment and I have so many difficulties getting it done. I'm supposed to write/code an address book where I could add, delete, display and sort data. I'm not too familiar with C++ as this is my first semester taking a programming course. This is …

Member Avatar for Schol-R-LEA
0
349
Member Avatar for cppgangster

I have strange problem and I dont know where it does come from. First I list here the struct I have problem : [CODE] struct _THREADPARMS{ //global definition in one of my header file HWND h_wnd; BOOL bContinueAccept; BOOL bConnected; CProgressCtrl* pProgress; CDialog* pDialog; }; [/CODE] then I declare global …

Member Avatar for cppgangster
0
705
Member Avatar for PrimePackster

Hello Guys, Well i have a problem, I coded a program to print the ascii table, then give the user a option to either convert character into ascii or ASCII to character. Well the latter is not working, and the loop to print the ascii table is having the same …

Member Avatar for PrimePackster
0
245
Member Avatar for Srinivas0

[CODE]#include <iostream> using namespace std; class Reverse { int n,num,dig,rev; public: void Rev() { cout<<"enter an integer number to check if it palindrome or not \t"; cin>>num; n=num; // rev=0; while(num>0) { dig=num%10; // 48%10=4 rev= rev*10+dig; // rev=48*10+4=484 num=num/10; //484/10 =48 cout<<num; } if (n==rev) cout<<"given number is palindrome"; …

Member Avatar for Srinivas0
0
171
Member Avatar for AlvinLiu

what is code mean? [CODE] void fo(){ count += 1 + !(count <5); cout << count <<endl; } [/CODE] Thank you .

Member Avatar for MandrewP
0
184
Member Avatar for l1nuxuser

Hello everybody i'am building a software to make lab management. So I need to save the data base. and i using SQLite. but I have problem the SQLite pramter is a const char. and the data from the software are CString. and becouse I using Unicode I can't convert them …

Member Avatar for kndubey88
0
646
Member Avatar for stereomatching

desired output [code] void desired_output{ namespace karma = boost::spirit::karma; unsigned int A[] = {10, 9, 8, 7, 6}; std::vector<unsigned int> v(A, A + 5); std::string generated; for(size_t i = 0; i != v.size(); ++i) { std::cout<<v[i]<<" equal to "; karma::generate(std::back_inserter(generated), karma::uint_generator<unsigned int, 2>() << karma::eol, v[i]); std::cout<<generated; generated.clear(); } } …

0
66
Member Avatar for babyhuyx

[CODE]int game = 3; int ckenonum; const int hkenostore = 4; int hkeno[hkenostore]; const int ckenostore = 4; int ckeno[ckenostore] = {1,2,3,4}; bool kenopass = false; for(int hkenostore = 1; hkenostore<4; hkenostore++) { do{ cout<<"Please enter a unique number between 1 and 15 (" << hkenostore << " of 3)\n"; …

Member Avatar for cutenaj12
0
2K
Member Avatar for Ty88

Hello everyone, it's my first time posting here and it's an urgent matter as I need the solution to this by midnight tonight :/ I'm really struggling with the all Big-Oh notation thing and I could really use your help. I have this C++ code: [CODE]void Teste::listarMaisAfastados() { int maior …

Member Avatar for Ty88
0
220
Member Avatar for qmanchoo

Good Evening everyone, long time lurker, first time poster. I have an issue trying to read information from a file that I'm struggling with. My function takes a file input object and reads information into arrays of type int, int, double, char (2 dimensional array). The file data looks like …

Member Avatar for WaltP
0
183
Member Avatar for ayaya3523

I have been working on this code all week and can not figure out why its saying that my identifiers are undefined.... Please Help! [CODE]class Invoice { public: // constructor initializes the four data members Invoice( string, string, int, int ); // set and get functions for the four data …

Member Avatar for Clinton Portis
0
517
Member Avatar for harde

[ICODE]* Slot Machine Program by Harde*/ #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { int x,a, b, c, token=4; srand(time(0)); cout<<"\t********************************************************\n" <<"\t* Welcome to slot machine. *\n" <<"\t* Would you like to play? (1 to play, 2 not to play) *\n" <<"\t********************************************************\n\n"; cin>>x; while(token!=0) {cout<<"You have …

Member Avatar for harde
0
339
Member Avatar for paranoidSandra

hi everyone!i'm working on a project and i'm getting two errors of the type mentioned in the title. here's the part of the code that generates the problem: [CODE] #include "Instance.h" //default constructor Instance::Instance(unsigned features) { num_of_features = features; fileName = "-"; category = true; keywords = new string[num_of_features]; featureID …

Member Avatar for paranoidSandra
0
172
Member Avatar for rockerjhr

UniversityDatabse.h [CODE]#include<string> #include<stdexcept> #include<iostream> #include<map> #include "UniversityPerson.h" class UniversityPerson ; using namespace std ; #ifndef UNIVERSITYDATABASE_H #define UNIVERSITYDATABASE_H class UniversityDatabase { public: UniversityDatabase() ; ~UniversityDatabase() ; void print() ; void Create(UniversityPerson *p ) ; void Delete1( string name ) ; void Delete2( string id ) ; UniversityPerson *Lookup1(string id ) …

Member Avatar for ravenous
0
409
Member Avatar for Hamilton89

I'm trying to make a thermometer that can show when the temperature goes out of the range of 17 and 24 degrees, when it goes below 17 degrees i want it to count how many times it goes below 17 degrees and how may times it goes above 24 degrees …

Member Avatar for mikrosfoititis
0
729
Member Avatar for sum337

Hey ive tried to learn C++ by myself at home and decided that the best way to motivate myself was creating ye old dos text game. Im stuck at this so far and was wondering how can i improve my basic layout? also since its a text game how could …

Member Avatar for WaltP
0
3K
Member Avatar for vyrte

hello everyone! i have a question about reading from a binary file.what if i want to start reading a file from a certain line of the file and end the reading to a certain line too? is there a way to do this using an ifstream?

Member Avatar for WaltP
0
166
Member Avatar for Srinivas0

[CODE]#include <iostream> using namespace std; class LoopEx { int x,y; public: void Ex; { x=3; y=x; // y=3 while(y<=1) // 3<=1 y--; // 3, 2 x=x*y; // x= 3*3=9 cout<<x; } }; int main() { LoopEx F; F.LoopEx(); return 0; } [/CODE] im trying to write a program for factorial …

Member Avatar for Srinivas0
0
106
Member Avatar for Taino

Hi, I am trying to complete this application. just using a simple Array. I have most of the instructions down and included some additional stuff I thought was practical; it seems to work up to a point. I will continue to explain. These are the instructions: 13.13 ( Cafeteria Survey …

Member Avatar for WaltP
0
372
Member Avatar for midgarsorm

Hi I have a question how can you store data. for example i have a txt document stored this data Jones Jr, brown K. johnson, James S. Smith, Mark J. and i want to divide it to last name and first middle initial like i want to store it to …

Member Avatar for Clinton Portis
0
155
Member Avatar for LateNightCoder

In my program I read in a text file an decrypt the text from an array. once decrypted i then have to do through it again and search for every tenth array member and show their memory location. The code so far: [CODE] int main( ) { int* pCrypted = …

Member Avatar for LateNightCoder
0
391
Member Avatar for Semeno

Hi. I'm new in C++ and I need your help. I've got a structure and file in .csv format. It looks like this: [CODE]Twelve Monkeys;Sci-Fi / Thriller;USA;1995;129;Terry Gilliam;MUSIC;Bruce Willis, Madeleine Stowe, Brad Pitt; American Gangster;Drama;USA;2007;157;Ridley Scott;Marc Streitenfeld;Denzel Washington, Russell Crowe; Star Wars: Episode VI - Return of the Jedi;Sci-Fi / …

Member Avatar for NathanOliver
0
258
Member Avatar for iffrah

we are to input list of 2 types of scores both of double type.The scores are to be stored in a two-dimensional array. How do i do that?

Member Avatar for WaltP
0
162

The End.