49,761 Topics
| |
I'm creating a simple platform scroller using C++ and the Allegro library, and also .fmp maps created using the tile-based editor Mappy. I have two maps created, which will serve as my two levels. Once the first map is run through, I want to switch to the second map. What's … | |
Employee.h [code]// Base class. #ifndef EMPLOYEE_H #define EMPLOYEE_H #include "stdafx.h" #include <cstring> // Constant for the name's default size const int DEFAULT_SIZE = 51; class Employee { private: char *name; // The name double empNum; // The employee number int hireDate; // Number of hire date on hand // Private … | |
Hello, I am a novice programmer in C++. I know only basic object-oriented ideas and my teacher thinks it is the worst thing that ever happened to mankind and because of that, I only know procedural programming. In addition, he has us use archaic compilers such as CodeWarrior from 10 … | |
Hi, I'm supposed to create a program where I want to purchase tickets to a theater based on rows and columns of the seats. The program uses two-dimensional arrays and constructors, and is supposed to display somethine like this: "ASU Gammage Theater 1. View available seats 2. Request tickets 3. … | |
Alright, so, I decided to write an IRC Bot in C++ to get used to socket programming. Everything went fine of course, but I have one bug: when the server sends me a PRIVMSG (a message sent by a user to the server, then comes to me) it prints a … | |
hi friends, i am doing visual c++ course , i got a image which captured from webcam, that image to be stored in 2d array can any one help me how to store that RGB image in to an array please. | |
Hi all, I am very much a beginner and I'm struggling just to pass this class..so go easy on me. I keep getting this 1 error and I cannot figure out why. I'm sure it's something simple but I'm at a dead-end here. This is the error I get, it … | |
I'm trying to do a program that gets the averages of positive and negative numbers in an array that consists of numbers I have to read from a file.txt. I'm having trouble in how to put the numbers in the file.txt into the array and I can't seem to understand … | |
Hello people I have a small doubt in operator overloading I am trying to overload the assignment operator. Here is my code for that [CODE] class rational { int x; int y; public: //All the constructos rational operator= (rational num) { // Why do we need to return a reference … | |
Hi everyone! This is my first post. I'm relatively new at c++, but not completely ignorant, so please bear with me. Anyway, I'm trying to create a game in a console application. However, I don't really know how to have multiple things happening at once. At this point, I want … | |
Hi everyone, I am working on a project that requires me to write a program which given a single word will search a database of thousands of songs and will return the artist, title, and the context in which the word appears in the song. Each song has a SongId … | |
Hi, I have a question about when you have compliled a Form application as a release where the product exists of: - exe.file - Program Debug Database - Incremental Linker File What I now wonder is that I have in my project some important usernames and passwords. My question is … | |
I am using a linked list for the first time and am trying to add an entry to the list. However I am getting an error in this section of code: [CODE]if (is_tri == true) { //add the triangle to the list ListElement *p = new triangle((*nodeVec[i]), (*nodeVec[j]), (*nodeVec[k])); triList.AddElement(p); … | |
How would I do something like this? I know that this will not work, I'm just using it to show what I need with help. When a user is suppose to enter a number, but instead enters a string or char, it gives him a cout message saying it doesn't … | |
will any body plz tell me about random access file.i need to know about write random data on random access file. this data can be of any txt file?kindle mention some initial coding.reply sooooon plzzzzzzz | |
Hey guys I am having a problem writing to my text file. I notice when the data is written some of it comes out as gibberish. Take a look and let me know what I am doing wrong. Thank you. [CODE] #include <iostream> #include <string> #include <fstream> using std::cin; using … | |
i am writing a program whereby i have written the instructions the shell of the program, and have written code for inputting values, but how do i collect all the information i have inputted. I am aware it involves arrays but can you help and point me in the right … | |
A square plate divided in 100 squares or nodes by a grid. the temperature of the nodes form a two-dimensional array T[i][j] .the temperature in all nodes at the edge of the plate is constrained to be 20*C by a cooling system, and the temperature and the temperature of the … | |
Hi everyone: I'm having problems constructing a loop and I'd appreciate any advice. This is probably a simple problem, but I just can't make it work! This isn't homework! I'm an old fart and I'm new to C++. Here's what I want to do: take a vector and insert it … | |
[code]#include "stdio.h" #define ROW 4 #define COL 4 void input_matrix (int, int, int A[][4], int B[][4]); void add_matrix (int, int, int A[][4], int B[][4], int C[][4]); void loadidentity_matrix (int, int, int D[][4]); void main (void) { int A[ROW][COL]; int B[ROW][COL]; int C[ROW][COL]; int D[ROW][COL]; int i, j; input_matrix (ROW, COL, … | |
Hello everyone, I am trying to make a simple web browser for my own benefit (not a school project). I have been looking through multiple videos on how to do so, and could only find 'simple' web browsers on almost every video for visual c++. Anyway, the videos work, but … | |
can anyone please tell how to read an image in turbo c++ and display it....?? | |
Stupid request i know :S but i wrote this program so long ago and my C++ knowledge is so bad i need help remembering how it works :( ive completely forgot how linked lists work ive been working with javascript + java and amoung all my uni assignments my brain … | |
I have a 2D array whose cells represent each character in a terminal window that can either be ON or OFF (boolean). [CODE] bool grid[24][80];[/CODE] Then, using the ncurses API, I grab a key press: [CODE]key = getch();[/CODE] where key is an int type. The 'q' key is what I … | |
So, I'm still working on my matrix class (in case anyone reading this also read my thread from the other day). I really like the array-feature that I can initialize an array with a list of numbers, such as [CODE]double array[2]={1,2};[/CODE] and would like to implement that in my matrix … | |
My program is created to output permutations. Depending on the input that I put in, I sometimes get the correct result, but it is not accurate. However, when I do "abc", I get the correct result. When I input peoples names, I get a random result. After trying to figure … | |
Hi all, Currently trying to write a piece of code for a project at university, with very little C Compiler experience I am struggling... Basically- we have 8 LED's, and 8 switches. We want 4 of the 8 LED's to light up at random when the program is run, that … | |
It compiles and runs, but after "Here is the starting empty cubes vector" prints, I get this message: [B] Debug Assertion Failed![/B] [B] Expression: vector subscript out of range[/B] Can someone help me, please? [code=CPP] #include "stdafx.h" #include <iostream> #include <vector> using namespace std; // Cubed integers class cubes { … | |
Hi.... I m doing my project in vc++ exp edition.. My problem is, i store my value in a textBox1.. Now i want to pass that value to the CAN variable type NCTYPE_UINT8 .. NCTYPE_STRING arr[100]; arr[0]=this->textBox1->Text; while compilation the error is raising like: "error C2440: '=' : cannot convert … | |
hey, i am new here but i have taken a few c++ classes. im having trouble with a very easy program and i just cant figure out why its doing this. ive looked around the forum already and didnt find anything helpful so i thought id ask. [CODE] include <iostream> … |
The End.