49,761 Topics

Member Avatar for
Member Avatar for oakes121

The Assignment is as follows: Write a program that allows the user to enter foods and their calories into two arrays. Allow for UP TO 100 entries, although the actual number may be way less. When the user types "done" then stop asking for new entries. Next, prompt the user …

Member Avatar for WaltP
0
87
Member Avatar for shayshep

I am trying to write a program that finds sin(x) using the function double sine( double x, double tolerance, int limit, int & nTerms). I know I have to use the taylor series but I am having trouble getting started. [CODE] #include <iostream> #include <cmath> using namespace std; double factorial(double …

0
52
Member Avatar for Darkest Shine

I need to scan for the following input type using C: number letter number so i used the follwing: scanf("%d%c%d", &n1, &lett, &n2); Unfortunately with this, whenever I attempt to input a single number and press enter, scanf continues to expect another input. How can I adjust the program so …

Member Avatar for Salem
0
124
Member Avatar for kenji

Hi, After several google searches, yes I did actually bother searching, I was hoping someone would be able to help me out. I'm trying to figure out persistent hash tables and the internet seems to be woefully inadequate in information, I was hoping some one here had a link or …

Member Avatar for kenji
0
62
Member Avatar for pyroclastic

Hi everyone, This is my first post on daniweb! I'm fairly new to C++ and am trying to add sound to my application using FMOD. Now, I have managed to get sound playing correctly using FMOD, but I'm now trying to get all the sounds I want loaded, into a …

Member Avatar for pyroclastic
0
97
Member Avatar for buckkitty

Hello, I am trying to implement a for loop which fills (and re-sizes) a temp matrix (temp_data) based on a column value criteria from another matrix (data). The data matrix comes from a text file which has the format: a b c d e f g h 1 i s …

Member Avatar for tetron
1
97
Member Avatar for cblue

Here is the formula i'm suppose to use: i'm suppose to to write a complete program with a function using two parameters to calculate: x(!)^n, where x(!)^n = x!! ... ! use BigInts For the calculations ----- n times this wis what I have, i don't think it's right, if …

Member Avatar for forough95
0
222
Member Avatar for detito

I wrote a code to read the parity check matrix named "tannergraph" which is stores in a sparse format to save space. It is in the following form: Line 1: Number of Variable Nodes(VN) Number of Check Nodes(CN) Line 2: Column weight Row weight Next VN lines: degree of the …

0
273
Member Avatar for merse

My problem is not serious, its just a question about the most beautifull solution. Maybe somebody has a better idea! I have a mathematical class having some numerical functions. It is convenient for me, and speed up the program, if I introduce a member array called "memory", and store the …

Member Avatar for mattjbond
0
169
Member Avatar for heynow12

I need help with understanding how to fix my for loop and the if tests. Originally, in the for loop, for the end value i had k<=3..but this is wrong because i need to loop to keep going until it passes the test. So i was told to try setting …

Member Avatar for phyrtech
0
166
Member Avatar for smeghead007

Ok I got the code to work but with some errors. First when i print out the aorted array to the file it is sorted escept for one number in the beginning second it gives me a negative number whihc i believe is a pointer how can i fix this? …

Member Avatar for VernonDozier
0
132
Member Avatar for hvalola

hi i want to read the joystick data to send through a socket. i try to understand the direct x example for joystick inputs but its difficult . if there are any solutions please reply or if there is a tutorial please send me links to joystick inputs

Member Avatar for Ancient Dragon
0
51
Member Avatar for strmstn

Hello. I am quite keen with the win32 api but am tired of the standard windows visual styles (XP/Vista/7) and am wondering how to create my own. Have googled but not found any information, just point me in the right direction. Thank you very much.

Member Avatar for tetron
0
144
Member Avatar for o0mkh0o

Hello! Im having a problem with the following code structure. The code compiles without problems but when i start the program i get an "exception: __non_rtti_object at memory location...". In the constructor of the model-class i still can get the object information of the node-class through the base pointer. Once …

Member Avatar for o0mkh0o
0
322
Member Avatar for Prota

Hi! I am making a project about doublepointers and inheritance. Have some small issues that should not be difficult to resolve, but I just cant get a grip of it. The task is to add two types of vehicles that have some of the same characteristics but not all. I'm …

Member Avatar for Prota
0
246
Member Avatar for PDB1982

I'm trying to understand how static ints work within classes, and I've fallen on some code that I don't quite understand how the answers come out to be what they are showing. [code] // static members in classes #include <iostream> using namespace std; class CDummy { public: static int n; …

Member Avatar for pecet
0
134
Member Avatar for stefy14

i am a University student pursuing a degree in computer science, it seems as though i really suck at validating things... well I just don't really get the concept i know its conditions but i when i try one it always seems to crash my program I've been trying to …

Member Avatar for tetron
0
131
Member Avatar for vaibhavbute09
0
31
Member Avatar for sean108

Can some one give me some code on how to use windows.h..... im making my project, about ATM, i want to make it look good so i need some code on how the use windows header. I saw this person using a goto(x,y) code... and I saw his exe file. …

Member Avatar for kendapcwiz
0
514
Member Avatar for AutoC

I'm getting this error at the end of my program... [code] *** glibc detected *** ./a.out: free(): invalid pointer: 0x00617ca0 *** ======= Backtrace: ========= /lib/libc.so.6[0x684ac1] /lib/libc.so.6(cfree+0x90)[0x6880f0] /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xc986f1] ./a.out[0x804ce2f] ./a.out[0x804973d] /lib/libc.so.6(__libc_start_main+0xe0)[0x631390] ./a.out(__gxx_personality_v0+0x7d)[0x8048de1] ======= Memory map: ======== 00110000-00111000 r-xp 00110000 00:00 0 [vdso] 005fc000-00617000 r-xp 00000000 08:01 687043 /lib/ld-2.7.so 00617000-00618000 r-xp 0001a000 …

Member Avatar for vikashkumar051
0
812
Member Avatar for wilsonz91

Hi, I would like to know if I could do this: if i were to enter 5 numbers, it would go like this: 5 4 3 2 1 I want to know if I can do it like: 54321 Basically I don't want the insertion to go to a new …

Member Avatar for WaltP
0
2K
Member Avatar for Learning78

Hi; I have build an MFC application in Release mode using vs 2005 (windows XP) but when I run this exe on another PC (WInXP/Windows 7) with VS 2008 or PC without VS, it doesn't run. I used Visual C++ redictributionpackage and . NET service pack 2.0 but it works …

Member Avatar for ashishchoure
0
69
Member Avatar for maresma

Hello everyone, I am C++ beginner and I have a basic questions regarding classes Referring to the code below, I am trying to access x and y from the coordinate class in method abc after having run the place method. I hope this is clear Here is my code: class …

Member Avatar for kbshibukumar
0
110
Member Avatar for nx86

In Excel, the columns are identified by a b c .... z aa ab ac .... az ba bb bc .... yz za zb zc .... zz aaa aab aac .... These identifications correspond to the numerical values as 1 2 3 .... 26 27 28 29 .... 52 53 …

Member Avatar for jonsca
0
112
Member Avatar for Alexia Ooi

This is the program i'm trying to develop. It's not an assignment or anything. I'm just a newbie trying out new stuff. But I'm getting frustrated with this. [CODE]#include <iostream> using namespace std; //========== struct ========== struct nodeType { string song; int rating; nodeType *link; }; //------------------------------------------------------------------------------ //========== function ========== …

Member Avatar for Salem
0
146
Member Avatar for Carrots

Hi there, Looking for some advice regarding the following hierarchy structure: [url]http://i40.tinypic.com/9a1us0.jpg[/url] I'm storing base class pointers in a std::list in my program: [CODE=c++]list<Vehicle*>mylist[/CODE] Is it possible for me to use Pure Virtual functions in the base class? For example: [code=c++]virtual int getMPG() = 0;[/code] Seems fine, as all derived …

Member Avatar for Ancient Dragon
0
112
Member Avatar for forceonez

please solve this question for me now.. thanks.. CSC1103 STRUCTURED PROGRAMMING Lab Test 2 Problem statement Write a program to read N data items into two arrays, X and Y, of size 10. Store the product of corresponding elements of X and Y in a third array, Z, also size …

Member Avatar for Ancient Dragon
-2
76
Member Avatar for g-company

Hello i want to retrive information of various fonts used in an RTF file.so that i can use it in my RichEditCtrl class.

Member Avatar for Ancient Dragon
-2
36
Member Avatar for TheWolverine

Hi all, I am in the process of optimizing my code and I was wondering what the fastest way is to compute trig functions. I profiled my code and to my astonishment discovered that one of the most time-consuming processes is computing cos(theta) and sin(theta) using the implementation of cos() …

Member Avatar for nezachem
0
132
Member Avatar for restrictment

Heh, well my daily project is near finished, and I was looking around for a way to get rid of punctuation from a character array. I looked through the web a bit, and only found immensely complicated formulas which I did not feel like dealing with. So my question is: …

Member Avatar for restrictment
0
204

The End.