49,761 Topics
| |
Hello! I'm getting this infamous problem: [B]Segmentation fault (core dumped)[/B]. Not sure what's going on. ='( Please help! I've red-ed and bolded the parts that I think are problems. In the following class, I'm trying to create a class called 'BucketHashTable'. I want to create an array of known size … | |
Hey, so I have to make a program that has to multiply two 3x3 matrices (among other things). I used classes to do the project, but I just can't seem to get this multiplication to work. Here is my code so far: [code]void matrix::mult(const matrix& u) { double c[9]; double … | |
I am very new to C++ and have the slightest idea where to start. Here are the directions for the project I'm doing. Below is a copy of the program that I have so far. An internet service provider has three different subscription packages for its customers: Package A: For … | |
Hello, please help me I am trying to write program that allows a user to enter 10 numbers, stores in an array and then displays each with it's square (no * no) and cube (no * no * no), I am able to get square but cube in not working, … | |
I'm making a header file to make, sort, and print a vector using heapsort. I keep getting a compiler error about my const char[100] array. Probably something really simple I'm missing...I hope. In function `void build_list(std::vector<T, std::allocator<_CharT> >&, const char*)': 16 expected primary-expression before "const" 16 expected `;' before "const" … | |
How do I find the Rand_Max on my system using C++ code? Just a theory question. | |
Ok so for a project in my comp sci class we have to make a banner using a field of stars. We must enable the user to enter the number of rows(at least 1 but no more than 5) and columns(at least 5 but no more than 50), as well … | |
I am having a problem with my program. We are supposed to ask for two numbers as input then half the larger and double the smaller. If the larger is odd then the smaller is added to an accumulator. My problem lies (i'm guessing) somewhere in the functions. Here is … | |
Hello, So I'm just starting to learn c++ and am trying to make a tic tac toe game. My problem is where it says (board[pMove - 1] != 'X' || 'O'); it's supposed to see if there is already an x or o in the spot and then place the … | |
Hey guys I am having issue with declaring an iterator of type vector. I know there are other errors within this file but I am more concerned with why these declarations arent working. Everyone gives me an error saying something along these lines for each iterator heapsort.h:45: error: expected `;' … | |
[CODE] #include <cstdlib> #include <iostream> #include <string> using namespace std; int main() { string names[] = {"Jim", "Rob", "Sam", "Tim"}; int i; i = 0; string stain; stain = "f"; while (stain == "f") { if (names[i] == "") { stain = "p"; } i += 1; } for (int … | |
I'm having trouble getting this situation to work: I've got a gui that will take the user's input, and pass along the string to a function in another class, called Command(String^ str) The command will process the input, and print off some statements using a function in the GUI's class … | |
Let's say I'm writing to a file a series of integers like this: 4 3 2 1 0 After writing the last number (or the last line), can I delete that last one? | |
1>c:\users\...\documents\visual studio 2008\projects\generic bst container\generic bst container\my_bst.h(80) : warning C4717: 'my_bst<int,int>::insert_sub' : recursive on all control paths, function will cause runtime stack overflow TEST.CPP #include <iostream> #include "my_bst.h" using namespace std; int main() { my_bst<int,int> ab; ab.insert(5,10); return 0; } MY_BST_NODE.H #ifndef MY_BST_NODE_H #define MY_BST_NODE_H #include <iostream> using namespace std; … | |
Hi guys.. I've started but don't know what to do next.. can someone please help. This is the question.. Q:- Write a program to define a class to implement the time of day. A clock gives the time of day, let us call this class ClockType. Furthermore, to represent the … | |
Hi! I need a bit of help with an array sorting issue. I would like to sort the contents of an array (double type values) in ascending order. The problem is that the array size is unknown - the array itself is the result of another algorithm carried out within … | |
Hi all, I am trying to reverse the numbers in an array using recursion, however, I am receiving an error that I can't figure out. If possible, I need some assistance on it. [B]Error:[/B] line 27 incompatible types in assignment of `int' to `int[5]' [I]intArray = reverseArray(intArray,low,high);[/I] line 57 invalid … | |
I've long looked at this site for advice, but I'm stuck now. I have an idea of WHAT I need to do, but don't know exactly how to do it. YES this is homework. NO I'm not asking for anyone to completely do it because I need to learn this … | |
I am very new to using the STL list library. From what I have been reading here and other places on the web is that I have to create a compare function to use within the sort member function of list. The reason being that the list node's contain structures. … | |
Hi i am in need of an explanation to the following: I have created a program to take in a string(stored in a character array). With my string,i must pass it into a function and 2 functions i have created are stringLength and toUpperCase.(i know there are string functions to … | |
Hi, I'm looking for a way to write programs for a pc on a palm and "compile" them (check them for compiling errors without actually creating an executable). Any ideas? Thanks | |
Hi guys, I have a static vector which holds objects of a class. I want this vector to be singleton i.e. be the only vector of this type which will indefinitely store the relevant objects. Unfortunately, a problem arises whereby, when I access the vector from a different class, for … | |
OK, so I have this project to do and cant figure it out. I am not positive on calling functions correctly and I am kind of lost when it comes to parameter passing. So my program needs to read a text file 1 integer at a time, find out if … | |
How would I call the function so the program runs through each option. I've got the program done but everything i run it, the options do not run. Any help? Thanks. [code]#include <iostream> #include <fstream> #include <iomanip> using namespace std; void readMatrix (double x[][30], int & m, int & n); … | |
can I open a file and then close it in a loop? I tried but it doesnt seem to work. :( | |
Hi everyone, I dint not post the complete program, just the most relevant parts. I think the problem is with conversion part towards the end . I cant print the correct values to the text or edit box on the GUI, it prints out some weird values. Thanks in advance … | |
Can Someone tell me why these files won't compile on unix but work fine (mostly) in windows? It looks like unix-land doesn't load the variables from the inherited class QueueArray into the proper scope. prog5.cpp is supposed to create 3 different types of Deque classes. each Deque inherits from ArrayQueue … | |
Hi, I am new with C++, can anyone help me with the following code. I will be highly thankful. Write a recursive function that has two inputs, first and second, which both are strings(from ). The function should print all rearrangements of letters in first, followed by second. For example, … | |
I have tried the two ways below to get my functions to call and run, but VS gives me the error error c2660: ..... function does not take 0 arguments First way tried [code] //Michelle CSI 130 Lab 11 Part 2 Section B //Digital logic and Boolean algebra #include <iostream> … | |
hi guys, i am ranjith intrested in writing c c++ progs i hav a doubt that can i write a c or c++ program to excute at a given time thanks |
The End.