49,761 Topics

Member Avatar for
Member Avatar for shywolf91

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 …

Member Avatar for shywolf91
0
2K
Member Avatar for gerard4143

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 …

Member Avatar for gerard4143
0
358
Member Avatar for Sohvkhan

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

Member Avatar for Sohvkhan
0
171
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
171
Member Avatar for MastAvalons

class A { public : list< string> getList (){ list< string> l; l.push_back ("str1"); l.push_back ("str2"); .... …

Member Avatar for mike_2000_17
0
168
Member Avatar for tom12

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

Member Avatar for tom12
0
135
Member Avatar for kearwood

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 …

Member Avatar for Labdabeta
0
453
Member Avatar for shywolf91

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 …

Member Avatar for Lerner
0
258
Member Avatar for Labdabeta

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?

Member Avatar for Labdabeta
0
908
Member Avatar for Prisms

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 …

Member Avatar for deceptikon
0
235
Member Avatar for logicmonster

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 …

Member Avatar for MrEARTHSHAcKER
0
861
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
416
Member Avatar for subith86

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

Member Avatar for subith86
0
132
Member Avatar for koricha

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

Member Avatar for histrungalot
0
92
Member Avatar for FelineHazard

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 …

Member Avatar for Ancient Dragon
0
7K
Member Avatar for kristen237

Which command reads one character even if that character is a blank space? :?:

Member Avatar for PrimePackster
0
207
Member Avatar for sujan.dasmahapa

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 …

Member Avatar for sujan.dasmahapa
0
97
Member Avatar for Susmita_Sikder

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 …

Member Avatar for zeroliken
0
160
Member Avatar for pwnerboy

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 …

Member Avatar for mike_2000_17
0
891
Member Avatar for jnewman3

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 …

Member Avatar for jnewman3
0
1K
Member Avatar for jackmaverick1

[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

Member Avatar for jackmaverick1
0
84
Member Avatar for kaosuvls

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

0
79
Member Avatar for Snow_Fox

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 …

Member Avatar for Snow_Fox
0
247
Member Avatar for chuyauchi

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 …

Member Avatar for Ab000dy_85
0
120
Member Avatar for _Nemesis_

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 …

Member Avatar for _Nemesis_
0
173
Member Avatar for rfrapp

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 …

Member Avatar for StuXYZ
0
255
Member Avatar for SCass2010

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 …

Member Avatar for Bench
0
195
Member Avatar for MrEARTHSHAcKER

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!

Member Avatar for MrEARTHSHAcKER
0
173
Member Avatar for Snow_Fox

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 …

Member Avatar for Snow_Fox
0
1K
Member Avatar for nine9hours

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 …

Member Avatar for ravenous
0
252

The End.