49,757 Topics
| |
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 | |
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 … | |
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 … | |
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 | |
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 … | |
The End.