49,757 Topics

Member Avatar for
Member Avatar for vinochick
Member Avatar for Dave Sinkula
0
897
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
260
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
823
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
914
Member Avatar for tintin.iitk

class A { A& a; public: A(): a(* new A()) {} }; There is a huge flaw here and before I compiled this code I was hoping that it will fail to compile, But it didn't. At first I felt like I had a big flaw in C++ as it …

Member Avatar for gusano79
0
244
Member Avatar for jjf3rd77

I keep getting errors in my code. I can enter the first number 1 fine but then is says that letter c or a is not initialized. What am I doing wrong? This is what i have so far [CODE]// Exercise 8.13: ComparingRates.cpp // Application that calculates the amount of …

Member Avatar for mrnutty
0
121
Member Avatar for Iam3R

i have just written a small program on DEV C++. i have been using it for couple of months but i never observed this error. [CODE] #include<stdio.h> int main() { printf("Welcome\n"); system("PAUSE"): return 0; } [/CODE] could not create makefile I/o error 32 any idea? what does that mean

Member Avatar for Iam3R
0
93
Member Avatar for dmm

Can I change a file stream object's read position in C++? I mean I have a file with a series of integers separated by a newline character. Can I read the first five integers into some variables and then move the read position back to read the fifth integer one …

Member Avatar for dmm
0
616
Member Avatar for Ashishinani1756
Member Avatar for NicAx64
0
108

The End.