49,761 Topics

Member Avatar for
Member Avatar for D4n1sD

Hello I got a problem while trying to use rand() fucntion. Just by using it its self it generates a random number from 0 to RAND_MAX. The prob is that I don't know rand max, so how can I make a costume generation, like generating from 0 20 or 0 …

Member Avatar for Fbody
0
99
Member Avatar for Ballistix

Hello I'm new to c++ i need help with a area and perimeter function. I can get the program to run fine with out using it as function but cant with trying to get it to run as a function. Here is my code: [code] #include <iostream> using namespace std; …

Member Avatar for Fbody
0
201
Member Avatar for timbomo

quick question how will i go about setting setting up characters to draw a shape such as a triangle. but the user must pick an odd # that equals to the shape . the one i have is simple but idk how to input the number the user choosen to …

Member Avatar for timbomo
0
293
Member Avatar for yznk

Im working on a knights tour problem. And ive run into some issues. Im able to get the program to run randomly till it finds a full tour but how would i go about running it only a 100 times and then printing the average number of moves the knight …

Member Avatar for HealBrains
0
179
Member Avatar for sexyzebra19

I'm trying to use matrix multiplication to multiply b onto a. Using the method I've written below, changes the values of matrix A which I've then realised messes up later calculations. Would the best way to get around this be to make two copies of the matrices A and B …

Member Avatar for sexyzebra19
0
94
Member Avatar for coachkrzyzewski

I'm making a binary expression tree, and to do so I'm reading in values and putting them into a tree node and a pointer to that tree node into a stack. How do I use the STL stack implementation with pointers to my TreeNode class? relevant code: [CODE] stack<TreeNode> s; …

Member Avatar for dusktreader
0
163
Member Avatar for centraspike

Hello, I need some help writing code for a stack using link list implementation without using the STL. Basically what the stack would do is to convert an infix expression to postfix and then show the results of the operation. The stack should utilize a class not a struct. I'm …

Member Avatar for mrnutty
0
122
Member Avatar for sleepybug

i m trying to do this program to get digits from a number using linked lists..but don't know something is wrong.a logical error:-/ at the place of actual output it shows nothing clear blank ecept the message.so here's the code: [CODE] //DigitNode.cpp # define NULL 0 class DigiNode { private: …

Member Avatar for mrnutty
0
129
Member Avatar for tikoti

Hi, I am having an issue with a program and I have ended up realizing I don't know how to pass an array as a parameter. It seems that when I do it the arrays length is one inside of the function, even though outside is different. Here is the …

Member Avatar for mrnutty
0
154
Member Avatar for SKP

I am using map <string, string> to create a map. Inserting and finding operations work fine on solaris, aix but core is generated on hpux. The error shown in core debug as follows: insert__7rb_treeXT12basic_stringXTcT18string_char_traitsXTc_T9allocator_T4pairXTC12basic_stringXTcT18string_char_traitsXTc_T9allocator_T12basic_stringXTcT18string_char_traitsXTc_T9allocator__T9select1stXT4pairXTC12basic_stringXTcT18string_char_traitsXTc_T9allocator_T12basic_stringXTcT18string_char_traitsXTc_T9allocator__T12basic_stringXTcT18string_char_traitsXTc_T9allocator__T4lessXT12basic_stringXTcT18string_char_traitsXTc_T9allocator__T9allocator_FRC4pairXTC12basic_stringXTcT18string_char_traitsXTc_T9allocator_T12basic_stringXTcT18string_char_traitsXTc_T9allocator__ () Has anyone faced the same issue and has got the fix for it??? Please share …

Member Avatar for Salem
0
139
Member Avatar for spartan118

Figured problem out. Please delete post. -- original text -- hey all I'm a novice C++ programmer and I'm stumped on a console app I'm trying to build [CODE]#include <windows.h> #include <stdlib.h> #include <tchar.h> #include <iomanip> #include <stdio.h> #include <time.h> #include <Winuser.h> #include <atlbase.h> #include <iostream> #include <conio.h> #include <direct.h> …

0
65
Member Avatar for daviddoria

When compiling some working code on Fedora 11, I am getting this error: [code] /usr/include/c++/4.4.1/cstdarg:56: error: ‘::va_list’ has not been declared [/code] I am using: [code] [doriad@davedesktop VTK]$ g++ --version g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2) [/code] Does anyone know what the problem could be? Thanks, Dave

Member Avatar for daviddoria
0
1K
Member Avatar for maharjun

i tried making a string class but my program seems to be repeatedly crashing. why so? I have the following two files in to my program 1.)Strng.h (in INCLUDE directory) [CODE] #ifndef __STRNG_H #define __STRNG_H #if !defined(__CONIO_H) #include <conio.h> #endif #if !defined(__STRING_H) #include <string.h> #endif #if !defined(__STDDEF_H) #include <stddef.h> #endif …

Member Avatar for mattjbond
0
176
Member Avatar for endframe

Hi all, I need some help finishing this program, I know it's easy but I'm new in C++ and programming. [CODE]#include "stdafx.h" #include <iostream> using namespace std; int main() { const int arraysize = 10; int a[arraysize] = {11,22,33,44,55,66,77,88,99,100};[/CODE] This is the start of my program ; a giving array …

Member Avatar for endframe
0
199
Member Avatar for marcel222

Hello all, I have a question about coupling C++ classes to a GUI, in a nice Object Oriented solution. The problem is as follows: I have designed a GUI application in a separate class Gui for instance, in a other source file I designed a hierarchical statemachine for my GUI …

Member Avatar for Ancient Dragon
0
153
Member Avatar for pato wlmc

Well first of all, hi, and thanks to all of you guys, cause this may be the first time I start a thread, but not the first time that one of you solve my problems. Anyway. I'm following an internet tutorial about API development, ( [url]http://www.winprog.org/tutorial/menus.html[/url] ) But rigth now …

Member Avatar for mitrmkar
0
709
Member Avatar for nike_jj4

Hello! I have the following problem> I have this 3 structures: [code] struct student { char name; int index; }; struct modul { char mod_name[10]; struct student st[10]; }; struct faculty { char fax_name[20]; struct modul mod[3]; }prom; [/code] ------------------ My question: How can i reach the name of the …

Member Avatar for nike_jj4
0
82
Member Avatar for chinnaedu

hello all I am looking for a sample C code for packet interceptor.... Any help is appreciated Thank you

Member Avatar for chinnaedu
0
83
Member Avatar for jiten_raulo

Can any one tell me how to put a part of program into a header file or how to work with multiple files? According to my book, I need to put the template and class part into a separate file and include the header as "counter.h". I have done same …

Member Avatar for jiten_raulo
0
136
Member Avatar for arunbt
Member Avatar for Nick Evan
0
53
Member Avatar for Christoph928

I have an assignment to write a C++ program that will ask the user for the name of a data file. This data file contains a list of drivers. The names are listed, one per line, in the following format: lastName firstName middleInitial and each part of the name is …

Member Avatar for WaltP
0
197
Member Avatar for karolik

So I have a LinkedQueue which is a queue that is implemented by LinkedList. I need to overload the = operator for LinkedQueue. [CODE]LinkedQueue& LinkedQueue::operator=(LinkedQueue& queue) { return *this; }[/CODE] As you can see Linked Queue is const...the problem is that in order to copy the content from queue to …

Member Avatar for mattjbond
0
117
Member Avatar for chinnaedu

hello all.... is there any possibility to get the entire packet as such when data is sent (since its sent in the form of packets) including the details like source ip,port etc...atleast from IP header.... cos i want to receive the packet and send the same packet as such to …

0
56
Member Avatar for Mridula J

Hi All, Refer me a good C++ book, specially for Exceptional Handling. thanks mridula.

Member Avatar for gnarlyskim
0
70
Member Avatar for gizgiz

[b]Purpose of the program:[/b] This program is supposed to use a void function called removeLetters to remove both uppercase and lowercase letters from a given string. The function isn't allowed to use square brakets (ie no arrays) and the only (1) local variable allowed must be a pointer. [b]Problem:[/b] The …

Member Avatar for gizgiz
0
135
Member Avatar for JHus00

[CODE]if (windspeed <= -40 && windspeed <= 40) { windchill = calculate(temp, windspeed); output(temp, windspeed, windchill); } else cout << "Error, please enter a number between -40 and 40 for temperature";[/CODE] I need to check to make sure a number, windspeed, is between -40 and 40. Can I do this …

Member Avatar for Ancient Dragon
0
90
Member Avatar for delhiris

HI Please tell me how to connect to database(i.e table) using graphical enviorment in c++.net

Member Avatar for Ancient Dragon
0
51
Member Avatar for gnarlyskim

I have to be able to read text from a file then manipulate it to find the average value of an integral over a given bounds [a,b] from an input file, then export it to another file. I do not know how to store the information to process it. Say …

Member Avatar for gnarlyskim
1
181
Member Avatar for rockstar8577

Hello i'm having trouble reading from files from fstream. I want to skip a word but don't know how to do so with input from files. [code] myfile >> avatar.name >> avatar.name >> avatar.name; myfile >> avatar.hp >> avatar.hp >> avatar.hp; myfile >> avatar.mana >> avatar.mana >> avatar.mana; myfile >> …

Member Avatar for jonsca
0
84
Member Avatar for sdgz747

I am supposed to be writing a program that will calculate sales in a week. Every week 200.00 dollars is earned, then sales is calculated on top of the 200.00 (i.e., 5000.00 in sales, would be 200 + .09 * 5000.00). My code is below, but I am having problems …

Member Avatar for sdgz747
0
96

The End.