49,767 Topics

Member Avatar for
Member Avatar for king03

Here we have a code that opens a filestream from a notepad but it doesn't open the notepad file. I have also attached the folder of the program itself so you can check it as your reference. please help us. Thank you very much! Please help. hre [ICODE] #include <iostream> …

Member Avatar for VernonDozier
0
206
Member Avatar for Thermalnuke

yet again i have become very confused on this program. This program is suppose to have the user be able to put numbers in from a keyboard or they have the choose of choosing a file with numbers in it. the program is suppose to acknowledge all the numbers in …

Member Avatar for Thermalnuke
0
163
Member Avatar for NoUserNameHere

[CODE] template <typename T> int ct2 (tnode<T> *t) { int ctLeft, ctRight, ct; if (t == NULL) return 0; else { return ct2(t->left)+ct2(t->right)+ ((t->left != NULL && t->right != NULL) ? 1 : 0); } [/CODE] I tried running it and I still can't figure out what it does. Specifically …

Member Avatar for NoUserNameHere
0
185
Member Avatar for mikenowo

I've been looking for an app that could find a specific open window on the desktop and 'lock' it so can't be re-sized or moved (most likely by using the title bar value/property). Having had no luck, I was wondering if this can be done in c++? I used to …

Member Avatar for mikenowo
0
194
Member Avatar for solid222

I am trying to solve this question (homework) that says the following : [QUOTE]Write a program that calls a function computeSphere that computes the volume and the surface area of a sphere with given radius. The function should not perform any I/O operations. [/QUOTE] the main problem is how can …

Member Avatar for Moschops
0
155
Member Avatar for king03

We are having problem with our code regarding file streaming. here is our code: [CODE]//Nava //Maganito //Ocampo //Lazo //Manata //CS133/BC2/PROJ #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <cctype> #include <cmath> using namespace std; void display(); void input(); void equate(); void calculate(); void lineChecker(); double num1=0; double num2=0; double …

Member Avatar for WaltP
0
225
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
122
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
214
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
156
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
436
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
225
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
351
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
714
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
250
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
172
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
187
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
662
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
221
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
520
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
347
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
174
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
422
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
740
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
167

The End.