49,757 Topics

Member Avatar for
Member Avatar for eavila

Hey, so as you can tell, this is my first attempt at writing a class. I put in a mock int main() in order to follow what exactly is going wrong. As far as I can tell, every time the struct in push is used, it always has the same …

Member Avatar for gusano79
0
142
Member Avatar for blackrainbowhun

Hello everybody! I'm participating in a competition, and I just finished my program. It doesn't really matter what it does, and how. I have encountered a bug I think. I'd appreciate every kind of help, because with the problem, my solution fails for the test file. I have to read …

Member Avatar for Schol-R-LEA
0
172
Member Avatar for Akusa

Okay so for my beginners c++ class we have to make game for our final project. The game is a simple shooter type game with ascii chars and stuff for the player and the enemy. We covered up to 2d arrays in class and then the teacher gave us the …

Member Avatar for Schol-R-LEA
0
414
Member Avatar for stereomatching

Now I have a lot of airplanes, in the ideal world the interface of the airplanes(or anything) should be unify but for some kind of weird reasons, the class for different airplanes are designed like this [code] struct airplane_A { fly_A(); speed_up_A(); //blah blah blah }; struct airplane_B { fly_B(); …

Member Avatar for stereomatching
0
104
Member Avatar for TheWickedKid

Hello... I'm practicing c++ and I'm trying to create a program with register and login in it.. the problem is I'm trying to compare the register username/password to the login username/password but even though the comparisons are right it's not working.. [CODE]#include <Windows.h> #include <iostream> #include <iomanip> #include <string> #include …

Member Avatar for Ancient Dragon
1
16K
Member Avatar for emitremmit

I am having problems with my program to add and multiply two 4 bit binary numbers. The part in which I am currently having trouble is when I run the program the output for the addition function is not correct. Instead of displaying the correct answer it is just displaying …

Member Avatar for emitremmit
0
273
Member Avatar for mc3330418

I have a text file with names, wins, losse. I have to take those in a write a function to find the average, and a function to sort the names in alphabetical order. I finally got everything into arrays but I cant do anything else. I don't think I'm understanding …

Member Avatar for Ancient Dragon
0
130
Member Avatar for Hiiero

I am currently trying to create a list of skills and each list of skills generates 3 to 10 skills to put in the list and then randomly generates the skills that it places in that list. But I don't want skills repeating,meaning if I have 8 skills going in …

Member Avatar for Hiiero
0
145
Member Avatar for kjs5533

Yo guys! How's it going? To give you a quick gist of my goals : I want to allow the user to enter a bunch of criteria for a book (title, author, etc) so I made a structure. Then I store that structure in an array so they can enter …

Member Avatar for pseudorandom21
0
456
Member Avatar for zaneulhaq

Hey guys, what i'm basically trying to do in this code is to write an array which is automatically written to a txt file in the order I have shown below, however, I not only get this error [code] --------------------Configuration: testmtl - Win32 Debug-------------------- Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved …

Member Avatar for Schol-R-LEA
0
263
Member Avatar for coolbeanbob

Not sure I understand what is going on with setw(). [CODE] I would expect the program below to output something like this 77 77 77 77 Instead, it does this: 77 77 77 77 77 77[/CODE] Why are the first three 77's not indented? [CODE]#include "utility.h" // setw example #include …

Member Avatar for Schol-R-LEA
0
223
Member Avatar for addision

Ugh! need help. Ok I am creating a form to calculate a conversion, actually one of 24 conversions to be decided by radio button. I placed the code to make the conversion under the "checkchanged" event of each of the radio buttons, turns out that's not a good idea as …

Member Avatar for thines01
0
241
Member Avatar for rajatchak

[CODE] #include<iostream.h> #include<stdio.h> #include<fstream.h> #include<string.h> class qa { char question[35]; char option[4][20]; int ans; //correct option no (eg 0 1 2 3) public: void getques() { gets(question); cout<<endl; } void getopts() {cin>>option[0]>>option[1]>>option[2]>>option[3]; } void getans() { cin>>ans; } }; void main() { int n; qa q; fstream file1; file1.open("questions.dat",ios::out); cout<<"\n …

Member Avatar for rajatchak
0
214
Member Avatar for Diogo Martinho

Hello everyone. I'm having quite a rough time with my program because my code isnt just working [CODE]#include <string> #include <iostream> #include <string> #include <stdlib.h> #include <windows.h> using namespace std; #include "DBase.h" #include "Client.h" list <Client> l; DBase *example; int main (void) { string user= "my username"; string pass = …

Member Avatar for Narue
0
272
Member Avatar for gpraveenkr04

Consider : char *n=123456; I want to convert it into: int b[]={1,2,3,4,5,6}; i.e. b[0]=1; b[1]=2; ..... b[5]=6; Please suggest the code to perform the same. Thank you....

Member Avatar for Narue
0
50
Member Avatar for airtoncbr

I've Just finished a program and it's taking various errors. Can you show me Where its wrong? [CODE]/******************************************************************** * Autor: Antônio Airton Cabral Neto * * Compilador: BC 3.1 Borland * * Ambiente: Tela de scroll do DOS * * Modelo de memoria: Small * * Data: 12/09 e 14/09 …

Member Avatar for airtoncbr
0
402
Member Avatar for riahc3

Hey I was wondering how I could write a binary file in Java with code in C++ using the reinterpret_cast function. If I remember the line correctly (not currently at work) it was: [CODE] file.write=reinterpret_cast<char *(&x)>,sizeof x; [/CODE] with x being a variable. How can I do that in Java? …

Member Avatar for riahc3
0
932
Member Avatar for vlaskiz

So I have to get a working program for analyzing text, picking up words that has got 2 symbols and which are numbers and if their sum is not more than 9 i has to delete them. I'm about to be done with reading and outputing text file. Theres also …

Member Avatar for vlaskiz
0
115
Member Avatar for Thermalnuke

This program is suppose to be a very easy code of a simple time machine. I have it all layed out and working, but the out put it not computing correctly.. I know it is something easy, but i have been staring at this code for a bit now, so …

Member Avatar for Thermalnuke
0
2K
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
162
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
184
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
193
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
153
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
223
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

The End.