49,761 Topics
| |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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: … | |
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 … | |
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 … | |
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> … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
hello all I am looking for a sample C code for packet interceptor.... Any help is appreciated Thank you | |
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 … | |
please suggest the some placement programs of mind tree company | |
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 … | |
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 … | |
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 … | |
Hi All, Refer me a good C++ book, specially for Exceptional Handling. thanks mridula. | |
[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 … | |
[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 … | |
HI Please tell me how to connect to database(i.e table) using graphical enviorment in c++.net | |
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 … | |
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 >> … | |
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 … |
The End.