51,593 Topics

Member Avatar for
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
203
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
513
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
106
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
70
Member Avatar for hemant_chawla89

HI i am working with visualc++08 ,but alas i recently found that my compiler does not have resource pack which enables buttons ,menus etc. on including "resource.h" i get several compiler errors . someone please tell me where could i get the resource.h or a resource pack for the compiler …

Member Avatar for hemant_chawla89
0
89
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
245
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
107
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
104
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
111
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
124
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
323
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
110
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 tux4life
0
134
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
264
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
48
Member Avatar for imwan

I have written this code which reads a file and stores it in a struct. and from struct it saves the data in a new file. The file name is inserted by the user and new file name is also generated dynamically. But it is giving error. HEAP CORRUPTION DETECTED: …

Member Avatar for DdoubleD
0
1K
Member Avatar for cokaznsyco72

I'm having trouble with this program from right out of the book. Its just supposed to write an integer array to a file that it creates. I've compiled it without any errors, but when I try to run it, it fails and tries to debug. can anyone help me figure …

Member Avatar for WouterLindenhof
0
149
Member Avatar for netengr2009

I am getting this exception when I run my code in a C# Web Server Application, but if I copy the same code to a C# console application, it works fine. [code] System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. [/code] And help would be …

Member Avatar for DdoubleD
0
96
Member Avatar for gretty

Hello I have made a function that determines whether 2 words are an anagram or not. [B]My Problem is:[/B] that if the word contains 2 or more of the same letters(eg hello, arrest, gall) the function doesn't work even when the 2 words input are an anagram, If i input …

Member Avatar for mrnutty
0
519
Member Avatar for esesili

Hi everyone, I have a problem about inheritance and I can not solve it since Monday. I have two classes [B](Student_Patient and Emp_Patient) [/B]inherited from [B]Patient[/B] class. [B]Patient [/B]class and [B]Doctor [/B]classes are inherited from [B]Person [/B]class. The [B]Doctor[/B] class has a member function[B]double get_fee_of_doc() const;[/B] which returns a double …

Member Avatar for NathanOliver
0
126
Member Avatar for adel_elrefaey

#include <time.h> // double RAND_MAX = 4294967296.0; //2147483647; // void aleatorio(); void warmup_random(double); void advance_random(); int flip(double); double randomperc(); double aleatorios_0_1(); long rnd(long, long); double Rseed; /* Random numbers seed */ double oldrand[55]; /* Array of 55 random numbers */ int jrand; /* current random number */ /* Initialize random …

Member Avatar for adel_elrefaey
0
742
Member Avatar for Cole

Hi everyone! I am starting my first year of college classes next week with an intended entry into a computer science major. I am most proficient in Java and PHP, and understand that C++ and the former are vastly different. In doing some research, I have found that my professor …

Member Avatar for northrider
0
156
Member Avatar for hollywoood

Hello everyone.... I have gotten this far with my mortgage calculator....the problem is the while loop and the actual calculation isn't working correctly. The while loop really doesnt do what i was hoping for it to do...and being pretty amature at this...i am not sure where to go. i built …

Member Avatar for hollywoood
0
772
Member Avatar for Roguey

I'm trying to write a peice of code that will convert all the uppercase characters in a word to lowercase, and to store that in an array. I know how to convert individual characters, and to output all these characters in the fixed lower case. The thing i'm unsure about …

Member Avatar for mrnutty
0
447
Member Avatar for CD-4+

hello , i am a newbie in c++ and desperately wanna learn it. icoded this but i m gettin some error [code]# include<iostream> using namespace std; class cat { public: unsigned short int age; public: void meow () { cout<<"MY AGE IS "<<age<<endl; } [/code] [code]# include"cat.cpp" int main() { …

Member Avatar for dgr231
0
160
Member Avatar for eaon21

[CODE] #include <iostream> #include <algorithm> #include <conio.h> #include <cmath> #include <iomanip> using namespace std; int main() { int terminals[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}; int count,row,col,i; int limitcomp[20]; int coordinates[2][20]; double smallest = 0.0; double current = 0.0; double x, y; int network = 1; double chunk, total; do { cout<<"Enter number of computers: "; …

Member Avatar for VernonDozier
0
148
Member Avatar for esesili

Hi all, I have a simple question. I am working on it for a long time and I feel that I am almost done except for a small problem. As seen below there is a member function of patient class. It takes variables name and visit_duration. In addition to these …

Member Avatar for Sky Diploma
0
148
Member Avatar for littlegal

I am writing in C and using using VC++ 2008, .net 3.5 sp1 framework using a USB - to serial converter for serial port -- it comes up as COM4 on Windows 7 x64 as the operating system. Need to read and write to a circuit board which gives out …

Member Avatar for VIeditorlover
0
172
Member Avatar for Schoorsteen

Hello, I am having a trouble with the proxy I am making with C++. I am connecting a client to a server trough my program. client talks to my program, program talks to server server talks to my program, program talks to client Like that. However, when I receive something …

Member Avatar for Schoorsteen
0
396
Member Avatar for maxbug

I have an MFC SDI application in VC++6. Data is read from disk in the Doc, converted, and displayed in the View. I have implemented a CDialog, launched from an entry on the main menu, in order to permit the setting of data display options. By including the CDialog's header …

Member Avatar for maxbug
0
105
Member Avatar for Traicey

Hi all I have a function writetofile() which save a record to a file but the problem is when its writting to a file it doesnt write the record in a correct order, here is the code for WriteToFile() [code=c++] void StudentC::WriteToFile() { ofstream Outfile; Outfile.open("File\\Student.txt", ios::app); Outfile << Count …

Member Avatar for group256
0
227
Member Avatar for chikool

error C2106: '=' : left operand must be l-value for (int m=0;i<4 && i%2==0; m*m =i) { cout<<"Multiplication of all positive even numbers which are greater than N: "<<i<<endl; }

Member Avatar for dgr231
0
112
Member Avatar for jen140

Hello all. I get a small problem compiling it. And get the next error: \client/windows/handler/exception_handler.h(72) : fatal error C1083: Cannot open include file: 'client/windows/crash_generation/crash_generation_client.h': No such file or directory So how i proceeded : Installed mozilla-build 1.4, reinstalled the windows sdk(to the latest version), and have Visual Studio 2008 Professional …

Member Avatar for jen140
0
148
Member Avatar for franksmule

Hi, I am having a problem trying to get a callback function to work within a class. Its from the DXUT Direct X source code example. I'm basicly trying to get a callback to call a function within a class. I'm stuck, been reading around looking at all these pointers …

Member Avatar for Tom Gunn
0
136
Member Avatar for dzhugashvili

I have this code: [CODE] #include <iostream> #include <string> #include <vector> #include <algorithm> #include <fstream> #include <stdlib.h>//(for atoi to work) using namespace std; void usage() { cout << "Usage: <input1> <input2> <output>\n"; cout << "\n see README for more details.\n"; exit(1); } int main(int argc, char *argv[]) { cout << …

Member Avatar for dzhugashvili
0
144
Member Avatar for nalasimbha

In my project there is a need to for multiple inheritances and I have figured out that i need to inherit base classes virtually. The code that I have works fine, but I would like to know in particular what happens internally during inheritance. The classes that i use and …

Member Avatar for nalasimbha
0
91
Member Avatar for eliza2044

Hey guys, I've been working with KML files for displaying placemarks on Google Earth. Through my C++ application I need to insert new placemarks in a generated file. Some example code follows and may give you an indication on what kml is and what i want to do. As the …

Member Avatar for eliza2044
0
174
Member Avatar for Jason123

Hi, i would like to know if list is able to achieve these : 1) to get the range of elements such as .. A list of 10 elements beginning from value 1 to 10. I would like to get the range from element 3 to element 5 and add …

Member Avatar for Tom Gunn
0
100
Member Avatar for tatainti55

Hey guys. I was just following lazyfoos' SDL tutorial when i got stuck on lesson 08. Everytime i try to compile and run the source code the program closes immediately and a window pops up that says "An access violation(segmentation fault) raised in your program.". :S The compile log: Compiler: …

Member Avatar for daviddoria
0
201
Member Avatar for esesili

When I compile the code below it generates more than 30 syntax errors. It does not make sense. The problem is probably somewhere in [CODE]Patient(string name_of_patient, int age_of_patient, string address_of_pat, double visit_duration_ofp, string ssn_of_patient, Doctor &doc);[/CODE] but I could not figure out the problem. I know it is not convenient …

Member Avatar for StuXYZ
0
130
Member Avatar for SFletch

Hi, I have SQL Server on a server. I need an applet, to appear within other peoples web sites that has read and update access to my database on my server. I would like it to be written in C# as the rest of the application is C# and I …

Member Avatar for SFletch
0
119
Member Avatar for charis89

Its my 1st time posting here... Do tell me if I am doing anything wrong. [code=c] cout << "Please specify a question that has a yes answer for your object and a no answer for my guess:" << endl; getline(cin, qtn); foundyq = qtn.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "); while(int(foundyq) != -1) { if(noTry …

Member Avatar for Salem
1
164
Member Avatar for Democles

Basically the idea is to center a string. I selected the total length to equal 80. I know there is no fail safe placed into this program. I know there is another way to do this. I am stuck in a way. The program works, but I think I am …

Member Avatar for TimeFractal
0
13K
Member Avatar for Vermillion

I'm trying to make a simple program to improve my use of pointers (because I suck very badly at that), and I was doing fine, until I found this problem: -- HEAP CORRUPTION DETECTED: after Normal block (#155) at 0x007D18F0. CRT found that the application wrote to memory after end …

Member Avatar for mrnutty
0
1K
Member Avatar for eaon21

our task is to determine how the computers should be connected into such a chain to minimize the total amount of cable needed. there are 20 terminals each has a corresponding coordinate(x,y). the user will just choose which terminal he will put his pc's. 1. you wil ask the user …

Member Avatar for eaon21
0
150
Member Avatar for esesili

Hi all, I have two classes [B]C[/B] and [B]D[/B] these classes are inherited from [B]B[/B] class. My question is how can I use a member function of [B]C[/B] at[B] D[/B] and at [B]D[/B]'s child classes? I tried to do it with a regular function but it does not work in …

Member Avatar for esesili
0
143
Member Avatar for ryno365

Hello. I'm a new c++ user after having used Java for a few years as well as php. I'm having trouble with strings and how they can be used with classes. This is what my runner.h file looks like [CODE]#include <string> #include "TestApp1.h" #ifndef RUNNER_H using namespace std; class Runner{ …

Member Avatar for ryno365
0
113

The End.