49,757 Topics

Member Avatar for
Member Avatar for webdragon89

If I where to have a matrix of say: 123 456 789 How would I write a getVal() functions so that row[0]col[0]=1 and so for?

Member Avatar for webdragon89
0
97
Member Avatar for pinsickle

[CODE]current = queues[i];[/CODE] This line of code is killing me. I am suppose to be doing a write method for an array based priority queue. However I cant seem to get the first node on the give part of the array. queues is of the Queue class which is a …

Member Avatar for pinsickle
0
135
Member Avatar for CSStudent728

Hello everyone, Background: I am currently attempting a project for a professor of mine, but I cannot integrate my formula properly into my code. The project calls for a conversion from numbers to words. (I last worked in C++ a year and a half ago, so any words that don't …

Member Avatar for WaltP
0
119
Member Avatar for DuffManLight

Trying to learn recursion. Problem asks to use recursion on non-negative number to insert commas. Ex: 20131 as 20,131. My program adds in an extra comma at end. Any help in pushing me in the correct direction to fix this would be appreciated. Tried to use a 'count' to determine …

Member Avatar for WaltP
0
1K
Member Avatar for Suicidal_tool

HOMEWORK HELP - Just so i stick by the rules. The second part of my assignment is to create an array object, and love and behold, im having problems passing my small array into the function. Bellow is my code of what i have done so far, the solution seems …

Member Avatar for mitrmkar
0
171
Member Avatar for amia

write a c program that computes the grade of a student using the formula. grade=40%major exam+30% ave of two long exams + 30%ave of 3 short quizzes.. Display the average of two long exams,average of 3 short quizzes and the grade of the student. Display also a message whether the …

Member Avatar for restrictment
-1
89
Member Avatar for Jeff_5_7

Ok i am writing a program with Arrays and could use a little help. I have to build a two dimensional array with data from a file. The file has date that first is two numbers followed by a list of charterers. So the fist line of data is 2 …

Member Avatar for NathanOliver
0
153
Member Avatar for wale89

Can someone help me with this code.. I have a function which is InsertNode() it is use for inserting a new node after the index in the double link list.. For example I want to add a node of value 6.0 after position 3 This is the code i write..but …

Member Avatar for mrnutty
0
97
Member Avatar for frag

[CODE]#include <iostream.h> float salary (int, float); int main() { int n,h,i; float r,GS; cout <<"Enter number of employees: "; cin >> n; for (i=0;i<n;i++) { cout << "\n Hours= \t"; cin >>h; cout<< "\n Rate= \t"; cin >> r; GS=salary(h,r); cout << "\nSalary=\t"<<GS << "\n"; cout << "Rate=\t"<<r<<"\n\n"; } return …

Member Avatar for vmanes
0
91
Member Avatar for asa88

this my cpp file : [CODE]//****************************************************** // Chapter 15, Programming Challenge 7 * // PersonData and CustomerData classes * //****************************************************** #include <iostream> #include "PersonData.h" #include "CustomerData.h" using namespace std; // Function prototypes void displayPerson(PersonData); void displayCustomer(CustomerData); int main() { // Create a PersonData object and pass arguments // to the …

Member Avatar for mrnutty
0
834
Member Avatar for akssps011

Hello all I wanted to make a text editor in C or C++. I wanted to make it for learning purpose only and also so that I can modify it further according to my personal use. I am good at C++ but do not have much experience at writing large …

Member Avatar for WaltP
0
172
Member Avatar for nike_jj4

Hello People, I've joined this forum and I need some help with sorting a vector of structures. Here is the problem: I have the following structure> struct student { char name[20]; char lastname[20]; int points; } class[10]; Can you help me figuring out a void function that will have a …

Member Avatar for WaltP
0
104
Member Avatar for gudali

I have a doubt regarding avl trees.i got a part of this code from the internet.But this code was mde to use with integer input.But what i need to do is to insert strings which are alphanumeric.I am using strcmp() for insertion..but the output differs from the actual one.. Can …

0
53
Member Avatar for fplgenius

I want as said in 'cout' to input 10 or more letters in this statement but when i try to run it when I enter more then 10 letters i get error that says:: Run-Time Check Failure #2 - Stack around the variable 's' was corrupted" so is there any …

Member Avatar for NathanOliver
0
84
Member Avatar for Nicris

say int a[]; int &p=a; int *q=a; what is the difference b/w p and q ?? Is it like q can retrieve the value of the address which it is pointing to where p cant do that ... or is there something else also.....

Member Avatar for NathanOliver
0
135
Member Avatar for return_Milk

A couple things to mention: 1.) This program uses system("PAUSE"); in the main function, if you are not using Windows, you might have to pull it. 2.) There are a couple lines in there that are not needed, I'm just using them to test the size of the array. My …

Member Avatar for return_Milk
2
136
Member Avatar for tulip6

hi every one........... i'm new in this forum and need ur help please.... i want to write a programme using c++ code, programme that find the optimal parenthesization of a matrix-chain product, then perform the optimal matrix -chain multiply 4 a sequence of matrices, but the user should enter the …

Member Avatar for TECHNICAL GIRL
0
283
Member Avatar for porchia

please help me what kind of programmed i must defend for my thesis... just a simple program that i can possibly past this coming February 23... haizt... hazzel...

Member Avatar for WaltP
-2
59
Member Avatar for superdhebz

Hi. I have two homeworks which is to make a Fibonacci series using iteration and recursion. Im finished with iteration. I got the right code for recursion its just that, I don't know how to show the numbers for the fibonacci, it only shows the answer. Here's the code: [CODE]#include …

Member Avatar for WaltP
0
96
Member Avatar for Excizted

Hi :) I am certain of when to use static_cast, but often I can get satisfactory results by writing the target type in a parenthesis. For example: [CODE]void* data = somePointer; SomeClass* new_ptr = static_cast<SomeClass*>(data);[/CODE] seems to work when replaced with [CODE]void* data = somePointer; SomeClass* new_ptr = (SomeClass*) data;[/CODE] …

Member Avatar for Excizted
0
139
Member Avatar for JaksLax

Here is my code: [CODE] /** * @file qsort.cpp * * @date 11/2/07 * * This program implements the non recursive version of quicksort */ #include<iostream> using namespace std; /** * Swaps two items * * @pre x and y are the items being swapped * @post Contents of actual …

Member Avatar for Nick Evan
0
84
Member Avatar for alenD

Hi all, I want to know how much memory does my umap allocates in ram. I have the following definitions std::tr1::unordered_map<string, long> umap; umap h1; i do some insertions and at the end i want to know how much memory my umap allocates in ram. How can i find this? …

Member Avatar for alenD
0
110
Member Avatar for delhiris

Hi I like to develop application what is connected to database using C++.Please tell me some tutorials. Essential for me is connecting to databease but i like to learn and using buttons ,drops down menus ,erors handling ect.With this stuff tutorials should have 20 pages.

Member Avatar for Ancient Dragon
0
69
Member Avatar for superdhebz

How do I get rid of the zero digit in this program? this is a factorial problem and I have to show the numbers to be multiplied before arriving to the answer. The problem is, in the iteration process, the number zero will show. How do I get rid of …

Member Avatar for superdhebz
0
751
Member Avatar for cool1_best1

We are using a singly linked list with head pointer to implement Stack ADT. The stack top is maintained at the [B]end of the linked list,[/B] i.e. stack top is the last item. Discuss whether this is a good design in term of time efficiency: In a stack of N-items, …

Member Avatar for mitrmkar
0
153
Member Avatar for clutchkiller

MessageBox(NULL, (LPCTSTR)"Test1", (LPCTSTR)"Test1", MB_OK); This code is popping up the window correctly, but it displays all squares. Whats wrong =(

Member Avatar for Salem
0
108
Member Avatar for makan007

[CODE] #ifndef Test_h #define Test_h #endif [/CODE] May I know what are the above 3 syntax for? How can I use it? Is is used only in header file?

Member Avatar for jonsca
0
142
Member Avatar for techie929

//Here is the function of inserting nodes.I tried using strcmp but its still not working. [CODE] void BinarySearchTree::insert(char* d) { tree_node* t = new tree_node; tree_node* parent; strcpy(t->data,d); t->left = NULL; t->right = NULL; parent = NULL; // is this a new tree? if(isEmpty()) root = t; else { //Note: …

Member Avatar for mitrmkar
0
104
Member Avatar for #define

hello everybody! i have given a question in which i was not allowed to use built-in 2d arrays of C++. I have to define my own class of 2d array in which both rows and columns were dynamically allocated. The hint given wast that "think in term of array of …

Member Avatar for Salem
0
55
Member Avatar for dls_20022002

i'm new to c++. i started with the following code and i have an, ISO C++ forbids comparison between pointer and integer ERROR. My my program is for a library. i am now trying to have it pull up my file and read then edit a bookfile. the area in …

Member Avatar for jonsca
0
621

The End.