49,761 Topics

Member Avatar for
Member Avatar for crystality

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 …

Member Avatar for abhi_elementx
0
227
Member Avatar for uncbball

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 …

Member Avatar for abhi_elementx
0
149
Member Avatar for vinochick

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 …

Member Avatar for jonsca
0
760
Member Avatar for maverick405

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, …

Member Avatar for abhi_elementx
0
2K
Member Avatar for railmaster7

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" …

Member Avatar for Dave Sinkula
0
202
Member Avatar for vinochick
Member Avatar for Dave Sinkula
0
898
Member Avatar for tr4shm4n

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 …

0
45
Member Avatar for scott6480

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 …

Member Avatar for Dave Sinkula
0
204
Member Avatar for Art_Vandelay

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 …

Member Avatar for Art_Vandelay
0
91
Member Avatar for lancevo3

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 `;' …

0
72
Member Avatar for rysin

[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 …

Member Avatar for jbennet
0
127
Member Avatar for daiceman

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 …

Member Avatar for daiceman
0
80
Member Avatar for dmm

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?

Member Avatar for William Hemsworth
0
77
Member Avatar for lotrsimp12345

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; …

Member Avatar for Kontained
0
195
Member Avatar for fadia

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 …

Member Avatar for fadia
0
285
Member Avatar for AnnaHa

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 …

Member Avatar for Clinton Portis
0
75
Member Avatar for NinjaLink

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 …

Member Avatar for basitkhan
-1
2K
Member Avatar for nguerrero03

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 …

Member Avatar for nguerrero03
0
539
Member Avatar for Afupi

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. …

Member Avatar for Afupi
0
328
Member Avatar for StaticX

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 …

Member Avatar for StaticX
0
97
Member Avatar for ybean4

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

Member Avatar for ybean4
0
75
Member Avatar for pac-man

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 …

Member Avatar for pac-man
0
830
Member Avatar for acdougla17

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 …

Member Avatar for restrictment
0
150
Member Avatar for react05

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); …

Member Avatar for react05
0
114
Member Avatar for dmm

can I open a file and then close it in a loop? I tried but it doesnt seem to work. :(

Member Avatar for shakunni
1
92
Member Avatar for newbie_to_c

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 …

0
54
Member Avatar for PopeJareth

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 …

Member Avatar for PopeJareth
0
253
Member Avatar for scc123

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, …

Member Avatar for Rashakil Fol
0
103
Member Avatar for mitchstokes225

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> …

Member Avatar for mikiurban
0
134
Member Avatar for ranjithgoud

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

Member Avatar for abdelhakeem
0
917

The End.