49,761 Topics
| |
i found this off some site and when i build it in vis c++, the errors are with the two random functions. will someone tell me why and how i can fix this. the random on line 15 and randomize on line 36. undeclared identifiers. [code] /* Jason Cordes */ … | |
I was once trained in C and C++ and am now brushing off the cobwebs and relearning C++. I am restudying the Borland C++ Builder and realized I needed to know more C++, so I began restudying Visual C++...by Spencer and Perry. I am writing software to anazlyze lake water … | |
Hi, Could anyone please check the following for me? I can't run it yet. Best Regards, zawpai | |
I am having trouble implementing a sort function for this link list. This list works just fine. I just want to be able to sort by name. When I run the sort function I get back this; -------IN------- bb aaa aaaa aaaaa aa bbb b -------OUT------- bb bbb -------------- I … | |
Ok so I am looking to read in a bunch of different types of data for a program, but I am having trouble doing so in a very robust way. For strings it's easy. [CODE=C++] string temp; getline(cin, temp); [/CODE] Simple and quite robust. For the rest I am having … | |
Hey. I want to make a packet structure, something like [code=c++]struct Packet { int cmd; /* command */ int len; /* length of body */ char body[30]; /* body (should be length of len though, might use std::string) */ };[/code] Now, if I recieve some data thru a socket (I'm … | |
Hey guys and girls. I am working on a project that needs to use templates. My professor didnt go over teh use of them in class, nor is our book very descriptive of them. Im assuming they are way easier than i make them seem, but some help , tips, … | |
[code= cplusplus] struct wheel_node { int contents; wheel_node* next; }; typedef wheel_node* wheel_ptr; class wheel { private: wheel_ptr arrow; public: wheel (); void print (); void spin (int distance); void move_to (int number); }; [/code] The constructor wheel creates a circular linked list as follows: arrow -> 5 -> 40 … | |
I have the following code but every time I go to compile it i get the same 3 errors and do not know why I am getting them. I have tried googling why but can't really understand any explanations that I am given and therefore cannot fix the errors. Any … | |
Does anyone know a good site that gives source code of the implementation of a Splay tree with the balancing of the AVL tree? | |
I am receiving over ethernet into a 'char messageBuffer[512]' and then passing it on by a function call to 'process((char*) messageBuffer)' then in process: [CODE] void process(char* theMessage) { myStruct messageBuffer; memcpy(&myStruct, &theMessage, sizeof(theMessage)); //this line is wrong } [/CODE] Im not sure how to properly put it back into … | |
Hey guys...i had an assignment i did last year and i had a problem linking the my files since the program was modularized..the lecturer accepted it with the errors since she also failed to figure it out..anyway i was scrolling through my work and today and i saw the code … | |
Hey, i have made this little guessing game and was wondering how i could clear the screen every time to ask the question if the guess is wrong, though keeping line's 15 and 17 displayer all the time, i've tried but got msessed up programs etc, please help me adjust … | |
[CODE]Hi Im completely new to programming and was wondering if anyone would be willing to help me with this exercise in C++. I have absolutely no idea how to do this exercise: ----------------------------------------------- Rational.h is a C++ header file which declares a class (Rational) which handles Rational numbers (i.e. fractions). … | |
can anyone please help me with my program, my hand in date is on monday so i really need some help thank you | |
[code] int doubles (int d); int minimum (int m, int n); int oddEven (int a); int main () { int num, i, sum=0, num1, num2; for (i=0; i<5; i++) { cout<<"please enter a number. "; cin>>num; cout<<endl; sum= sum + num; } cout<<"the numbers added together is "<<sum<<endl; cout<<"the sum … | |
I have been reading older C programs to try and understand how to convert them to C++. One particular line of code still confuses me however. fscanf(fin, "%d", &n) I understand that fscanf reads from the stream (the file pointed to by fin), it reads the data which will be … | |
I'm trying to implement a very simple networking solution in C++. I've found a couple guides, but they all go far above and beyond what I actually need to do, so I figured I'd ask. I need to connect two computers. One computer will be broadcasting a (changing) integer on … | |
Hi all! I just want to know a website or book that will start me with c++ programming. I have downloaded Microsoft c++ toolkit 1.01 2003 to start from so i have the place to start :!: Thanks! | |
How to do a selection sort? Which I want to sort in descending order this data 1 50 2 90 3 40 | |
I am trying to now multiply matrices stored in 2d arrays. When the program runs i get segmentation fault, using DDD i found the point where it stops after 3 loops. [code] int i,j,k; float** matrixc = new float*[rows]; if (matrixc != NULL) { for (int x = 0; x … | |
#include <iostream> using namespace std; int main() { const int NUM_NAMES = 20, Size = 17; char names[NUM_NAMES] [SIZE] = {"lonney, Bill", "travis, Jim", "Harrison, Bob", "Holland, Beth"}; i need a simple program that uses the selectionSort function so it searches an array of strings instead of an array of … | |
Hi, I created 3 combobox: comboBox1, comboBox2 and comboBox3. I wish to select the require combobox according to different case. I tried to use comboBo(i) but it return me error.For example, [code] for (int i=0; i=3;i++) { textBox1->Text=comboBox(i)->SelectedItem->ToString(); } [/code] The code return me error on selecting "comboBox(i)". I knew … | |
I'm trying to write a data structure for a basic 3D engine, but for some reason it always crashes when I try to add an index to the polygon vector. Anyone know what may be going on? Thanks [code] #include <iostream> #include <string> #include <iterator> #include <vector> #include <gl/glut.h> #include … | |
I am trying to add sound into a whack a mole game for my C++ 101 class. I found this code on the internet [code]PlaySound("woofwoof.wav",NULL,SND_NODEFAULT);[/code] to add code and have it work the site says this: "It's defined in <mmsystem.h> and you have to link with winmm.lib." What does it … | |
A simple array: int array[3]={1,2,3}; In GUI, I want to make the picturebox a element of an array, like: XXX array[3]={pictureBox1, pictureBox2, pictureBox3}; so what is "XXX"? By doing this I would like to control whether a pictureBox is visible or not, but the picturebox number depends on a changing … | |
How to declare the array and read the array? Must I use data structure? [U]Two array[/U] 1 30 2 20 3 10 4 50 5 15 | |
I am writing a function and need to calculate the median...I am gonna b honest I absolutely have no idea how to start this but it is pretty much one of the last things I need to do with my program. Any advice would br greatly appreciated..... [code=c++] #include <iostream> … | |
I cant figure out how to fix the errors in this prooram. Any help would be great. [CODE=cplusplus] // date: April 25, 2008 // username: dpfaff #include <cstring> #include <fstream> #include <iomanip> #include <cstdlib> #include <iostream> using namespace std; const int MAXCHARS = 25; const int MAXSIZE = 6; typedef … | |
I'm trying to implement a menu choice, so the user can define what kind of triangle they have, with the focus on class implementation. I'm trying to define a class attribute that offers the choices, but then depending on the choice, sends the compiler to the appropriate attribute. Example: [CODE]int … |
The End.