49,761 Topics
| |
I need help finishing this assignment. I am really confused! [CODE] //Game of Life //Dylan Metz #include <iostream> #include <string> #include <fstream> #include <cstring> using namespace std; //function(s) void GetFile(); //Get filename char MakeArray(); //Make 2d array char ChgArray(); //change the array char GameBoard(); //Game Board //Global Variables const int … | |
Is it possible to pass a map container to the copy algorithm and display it to the std::cout? If so how? What I tried below doesn't work but it looks like it should. Any comments or pointers will be appreciated. [code] #include <iostream> #include <string> #include <map> #include <algorithm> #include … | |
[CODE]#include <iostream> using namespace std; int main() { { int count; int innercount; count = 1; while (count <=1) { innercount = 1; while (innercount <= (12 - count) /2) {cout << " "; innercount++; } innercount = 1; while (innercount <= count) { cout << "@"; innercount++; } cout … | |
I have a program that dynamically allocates an array and uses it. The thing is that under certain situations this array will get infinitely long. As such I would like to know if/when the array has gotten too long and then start saving it to a file (where length will … | |
class A { public : list< string> getList (){ list< string> l; l.push_back ("str1"); l.push_back ("str2"); .... … | |
#include <iostream> #include <string.h> using namespace std; int main() { char clear[200]; char cipher[200]; int x,i; int opt; cout<<"Encrypt (1) or Decrypt (2):"; cin>>opt; if(opt==1) //my problem is its not giving me option to enter string { cout<<" Enter a string:"; cin.getline(clear,sizeof(clear)); x = strlen(clear); for(i=0;i<=x-1;i++) { cipher[i] = clear[i]+3; … | |
BELOW IS WHAT I HAVE SO FAR...IT WILL COMPILE, BUT WHEN I DEBUG, IT SAYS THAT "YEAR" HAS NOT BEEN INITIALIZED. i HAVE TRIED EVERYTHING...BEEN THRU THE BOOK, TRIED GOOGLE-ING THE ANSWER...HARDEST CLASS I HAVE TAKEN WITH A PROFESSOR WHO DOES NOT EXPLAIN OR TEACH. DONT EVEN REALLY KNOW WHAT … | |
Okay I need help getting started. Here is the assignment: [CODE]Conway's Game of Life For this assignment your are to write a program, that plays Conway's game of Life. See the Wikipedia definition, if you have never played the game: http://en.wikipedia.org/wiki/Conway's_Game_of_Life. Here is how our implementation will work: (1) The … | |
Hello, I have been working with opengl and other graphics libraries and they all require the bits per pixel of the screen on initialization of a window. My question is, is there any way to get the system's preffered bits per pixel? or that of the monitor? | |
Hello everyone I'm currently working on a program that takes a student name and number of classes. Then asks the user to enter the his classes. I have most of the program done but I'm having trouble with my dynamic array for some reason it wont let me type in … | |
I am having a problem displaying random numbers, I'm trying to make a dice game where you play against the computer and the first one to 100 wins. However, my random number is never random, it always comes out as the same number. From what I understand to simply display … | |
A friend of mine recently asked me to help debug some code. I looked through it and it was riddled all over with goto statements. I know why he uses them (he used to program mainly in assembly and batch) and I tried to explain why he should try to … | |
Hi, I have overloaded assignment operator like below and it worked perfectly fine. [CODE]void Test::operator = (Test& obj) { this->a = obj.a; this->b = obj.b; } [/CODE] But when I googled more about this, I could see all of the examples used a different prototype like this [CODE]Test& Test::operator = … | |
lets say i enter this Array : [0 0 1 2 3 4 5 0 0 0] what should be the output of sparse array ? thank you | |
Hi all, I want to know if there is a smart way in c++ to test if my variable (or pointer) was already initialized? For example, I have a linked list, and I want to add an item to that list. If would like to do some thing [CODE] if … | |
Which command reads one character even if that character is a blank space? :?: | |
I am trying to create a toolbar on my dialog, so I am creating it in the OnInitDialog() function, but the toolbar is not coming. please help me finding whats going wrong in this. Thanks Sujan [code] BOOL CDlgsViewDlg::OnInitDialog() { CDialog::OnInitDialog(); CToolBar m_FirstToolBar; if(!m_FirstToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP … | |
hi all, when i run the program in console when i want to enter value the emp_name,basic are skipping and hra,da,gross,net are not calculating,pls give me solution where i am wrong? thank you in advance. the programme is : #include <iostream> #include<stdio.h> using namespace std; class Employee { protected: char … | |
What we are to do is pretty much mentioned in the comments of the code. I have to make a class ARRAY, which searches a list etc... Right now I can't compile this and I'm so stuck. Please help :) Array.h [CODE] // Put comments about the class here. #ifndef … | |
So I have a matrix class that must run on a unix/linux server. The main is a test file that is provided by the instructor. When I compile my code in visual studio it works fine except for test 8 because I can't figure out how to return a print … | |
[CODE] #include <vector> #include "Rab.h" class Envo { vector<Rab> items; };[/CODE] the error is: [ICODE]error: 'vector' does not name a type[/ICODE] I can't find ANYTHING that's wrong. Is someone else able to find it? BTW, Rab.h contains the class 'Rab'. Jack | |
Ok Guys this is what I have to do: o Provide six test plans to verify the logic within the program. o Plan 1 must display the proper information for employee #1 with overtime pay. o Plan 2 must display the proper information for employee #1 with no overtime pay. … | |
I need to take in a sentence and break it up based on the individual words. I've been googling for probably 30+ minutes to 60 ish and I feel it's time I get some help on this one.. Ideally, there should be a way to break up a string possible … | |
I have problem on my program. Can anyone help me to fix it and explain to me a little bit? [CODE] #include <iostream> #include <iomanip> using namespace std; void displayResult(); void welcomeMessage(); void game(); int main() { welcomeMessage(); displayResult(); displayResult(frequency, expected, intRepeats); } // end main void welcomemessage { cout … | |
Hi guys, Brief Background: I'm currently working on a project in which I wish to create an autonomous game agent capable of traversing 3D environments. To do this I would like to implement a custom path finding algorithm that works with a navigation mesh. The Problem: I'm currently looking at … | |
I'm trying to finish this assignment for class, but I've got a problem.It seems as though my code will always make the new generation blank, and I'm not sure why. If you could read my code, then I'd greatly appreciate it. Thanks! [CODE] // Life.cpp : Defines the entry point … | |
Hi everyone :) At the minute I'm working on some stuff learning c++ and was wondering if ayone could offer some advice... Say I have a pile of objects that need to be created (for example say, a Log object, XML parsers object, and a command line parser object). In … | |
Hi, When writing a little code for showing ASCII characters in C++ and C, the only difference is when I do it in C++ I print until char ( or integer ) reaches value of 127, and in C I print until it reaches 255. Why it's like that? Thanks! | |
So, I'm doing a program that is suppose to convert a sentence into pig latin. I figured I would make a function which would handle the individual words, then I'd work on breaking up the sentence into individual words. I keep getting the error that my String Subscript is out … | |
I made the following program, but now i am getting an error. I searched for error almost 3 hours but worthless. I want to discuss the problem with you people. I am getting the error: [B] expected class-name before '{' token[/B] #ifndef ASKDIALOG_H #define ASKDIALOG_H #include <QDialog> #include "umerwindow.h" namespace … |
The End.