48,986 Topics

Member Avatar for
Member Avatar for jko2326

How do I read two different data types from a .dat or .txt file? For instance I have a file that is an inventory file that shows the item reference number, the item name, and the quantity available. Example of what the file may look like: 01 Textbook 54 02 …

Member Avatar for Protuberance
0
147
Member Avatar for beau_nerdathen

[TEX]Please help me about my project "Array Alphabet"[/TEX] this is the example output: a b c b c d e d c d e f g f e d e f g h i h g f e * I don't know how to start the program. Give me ideas. …

Member Avatar for mrnutty
0
91
Member Avatar for newbieneedshelp

Ive been working on this poker program for a while now and ive tried several different ways to make a poker game...i have to make it using very basic c++ ...ill try to post what i already have done

Member Avatar for Justin7
2
119
Member Avatar for kspicer

I'm supposed to write a function that takes an input, and then outputs a set number of digits based on an array. The code I have works for the numbers 1-10, but anything above that messes up because it goes on to a value that doesn't exist in the array. …

Member Avatar for kspicer
0
104
Member Avatar for bishop101

Hi guys, I'm just starting out and I'm having a little problem. When I run an application, it closes by itself right away. A few days ago I went to the Local Library and picked out "Sam's Teach Yourself C++ in 24hrs - I know it's a lie" It came …

Member Avatar for Dave Sinkula
0
94
Member Avatar for neha arora

i wanna know that if a program consists of 10 lines n if we compile it , it shows increased no of lines compiled why:icon_question:

Member Avatar for necrolin
0
87
Member Avatar for jake43

I need help to write this program. Create a data file that contains 15 integers, some positive and some negative. You may create the file in Notepad or any other text editor software. Save the file to the same folder your program will be in. Write a program that reads …

Member Avatar for poncho4all
0
84
Member Avatar for jko2326

Please help, this is for an assignment I need to turn in and I'm STUCK! I have no idea how to do this I've done programs but none like this calling differnt functions. this is what is in the data file. 100 Hammer 10 20 10 200 Saw 24 00 …

Member Avatar for poncho4all
0
419
Member Avatar for the great

Hello! I am having a problem in this program.In it a have to calculate the value of π from the infinite series π=4-4/3+4/5-4/7+4/9-4/11+..... by using this formula i have to print a table that shows the approximate value of π after each of the first 1,000 terms of this series. …

Member Avatar for StuXYZ
0
275
Member Avatar for ryancfc

Hi all, I am having trouble in finding out how to point to a private member variable. E.g. : [CODE] #include <iostream> using namespace std; class Angry_Dude { private: int health; int attack; } [/CODE] I want to point to the address of health. I know about the homework policy, …

Member Avatar for VernonDozier
0
89
Member Avatar for goody11

Hey, I was working on a program that would ask you a question and you had to put an answer. Well, when I went to compare the answer the user inputs with the right answer, it always comes up wrong and I was wondering if I did these lines of …

Member Avatar for goody11
0
128
Member Avatar for esesili

Hi all, I want the program below to calculate the doctor fee. I am doing it to learn class and inheritance concept. "[B]patient1.output(cout);[/B]" works correctly it gets [B]doctor_hour_fee[/B] from [B]doct1[/B] object. The problem is at [B]patient2.output(cout);[/B]. When I enter patient information it asks me to enter all member variables of …

Member Avatar for Sky Diploma
0
111
Member Avatar for the great

Hello! I am having a problem with my program.I have to write a program that find all pythagorean triples for side1, side2 and hypotenuse all no longer than 500. I have to use a triple-nested for loop that tries all posibilities. I know that the sum of squares to two …

Member Avatar for Salem
0
881
Member Avatar for the great

Hello! I am having a problem with my program.I have to write a program that uses repitition and switch statements to print the song "The Twelve Days of Christmas." One switch statement should be used to print the days (i.e "First","Second" etc). A separate switch statement should be used to …

Member Avatar for the great
0
1K
Member Avatar for Nogat21

I'm having a bit o a problem with inheritance. The context is this assignment i have in which we have to read from an mp3 file, extacting the informations within it as well as provide other informations not explicitly contained in it (for instance the total audio time of the …

Member Avatar for Nogat21
0
201
Member Avatar for vwyodapink

Last week for class I wrote the program below. This week part of our assignments are to the program take this program and modify it so the user can display the grade for as many students as they choose. What I am not understanding is, is it asking to be …

Member Avatar for VernonDozier
0
512
Member Avatar for Yee

OKay... I have a newbie question. [code=c++]#include <stdio.h> class Test{ public: Test(int x); }; int Test::Test(int x=0){ } int main(){ Test test(1); printf("%d", test.x); } [/code] My question is how to make the x variable of the constructor public. I have tried to add : [code=c++] public: int x = …

Member Avatar for mrnutty
0
104
Member Avatar for troels_y

im about to make a program, that changes the desktop background at morning, day and night... right now i uses a bat file, but it pops up all the time.. and that does not look nice.. i want it to be done through the c++ program (need the help before …

0
69
Member Avatar for Smoking Bros

Hello everyone! The title is actually most of my compiler output! This is my entire compiler output: [CODE] multiple definition of `game' first defined here ld returned 1 exit status C:\Documents and Settings\Benjamin Dahse\Skrivebord\SDL 2D Platform Game\Makefile.win [Build Error] ["2D] Error 1 [/CODE] And now this is all of my …

Member Avatar for Salem
0
238
Member Avatar for neppy

[QUOTE=nunos;949210]Hi I would like to know if there is any way to obtain a float result from a division between two integers other than using "from __future__ import division"? I am not looking for the .0 'trick'. Example 4/5.0 = 0.8. I want to be able to do 4/5 = …

Member Avatar for neha arora
0
102
Member Avatar for athlon32

I've been learning DirectX, and overall, I'm really happy, it's not to hard and i can do tons of stuff. Now that I'm on more advanced things like meshes, i've run into a couple questions that i needed answering. 1. What is a good free program for making meshes? (One …

Member Avatar for kvprajapati
0
100
Member Avatar for macla
Member Avatar for cougarclaws

Is there an easier way to understand what this is doing step by step? I get very confused here, and I wonder if any of you fine people have a trick for breaking this down. I really want to get this, and understand the pattern, but what happens in the …

Member Avatar for cougarclaws
0
107
Member Avatar for prodigyaj

Hello all, This is my first post in thins forum and I hope a newbie like me makes some sense with my questions. I have a floating value float f = 5.3606; and I output a value cout<<pow(f,n); when n goes above 6, the representation of the floating number changes …

Member Avatar for vmanes
0
119
Member Avatar for dzhugashvili

hey, I am writing a password cracker. But I now have been thinking about separating the word generator from the actual encrypt and check function (for the sake of flexibility and convenience). I noticed John the Ripper does some operations like this. I was thinking something like this: [CODE]wordgen --stdout …

Member Avatar for dzhugashvili
0
300
Member Avatar for hardya

I recenty had a telephone interview in which I was asked about the internal implementation of the virtual mechanism. I described roughly that a table is compiled with the class (at the top of the memory block?) which holds pointers to the addresses of the appropriate method implementation according to …

Member Avatar for Frederick2
0
105
Member Avatar for adel_elrefaey

why he put this symble ( p-> ) before each variable? what is it means [code=cplusplus] p->fx[0] = (-p->x[0]*p->x[0]+p->x[1]); //-x1*x1+x2 /*function 2*/ p->fx[1] = (p->x[0]/(double)2.0 + p->x[1] + 1); for (i=0; i<NumFun; i++) if (MINMAX[i]==0) //minimiza p->fx[i]=-1*p->fx[i]; evaluaciones++; } /*Put here the contraints*/ void restricciones(individuo *p) { p->factible=1; //first constraint …

Member Avatar for mvmalderen
0
131
Member Avatar for neppy

need help 1. Which of the following options is a correct C++ instruction to calculate the number of containers filled with milk that can be sold? 1. nrContainers = totalLitres - litresLeftOver; 2. nrContainers /= 5; 3. nrContainers = totalLitres / 5; 4. nrContainers = totalLitres % 5; 5. nrContainers …

Member Avatar for neppy
0
258
Member Avatar for malugirl4

I have just completed my java code for the game engine maze I have been working on. We are told to download MARS and from java code it in assembly. I have never learned assembly. So I am completely lost. I so far downloaded MARS and uploaded my java code. …

Member Avatar for wildgoose
0
5K
Member Avatar for Eric_

Hi , i recently joined daniweb and it seems to be a nice site ;) Now to my problem: I am trying to reverse engineer an audio file format (not a common one). What i need is a function that can read the data from the file to the soundcard …

0
47

The End.