49,757 Topics
| |
My assignment is to create the Game of Life. I know that it is very easy to find out how to do this online, but I don't want the answers fed to me. Here's what I have so far: [CODE] // Life.cpp : Defines the entry point for the console … | |
So i have a program i am writing,and i have come to problem. I want to be able to pass a set of three strings into a function, which should then take them and add them to a Vector. All good so far, now is where my problem develops, how … | |
What I am trying to do is the following: [CODE] ReceiptBag zero("zero"); ReceiptBag one("one"); ReceiptBag bags[2]; bags = &zero; (bags+1) = &one;[/CODE] Of course that is not valid code. My goal is to be able to reference the same zero or one object by using its variable name or by … | |
hello, im totally new to this forum, but i already checked whether my ask is answered somewhere else already. i couldnt find anything... i used to work with dev-cpp and i have to work with the cnum.h library a lot. Since im a student i am able to get MS … | |
Hi Everyone, I am Actually trying to make a simple C++ game in which some random alphabets will fall down and when we press one of those random alphabets keys the aphabet should disappear. The problem that i am facing in making this code is that when i am using … | |
Hi! I am new to this forum and for c++ also. Can any one tell me the exact difference Createthread,beginthread,beginthreadex........ I have searched many links but not of much use...... Sharath. | |
Hi All, Why my QueueUserWorkItem is not at all working. My code is here: [CODE] typedef struct { PCHAR URL[MAX_URL] ; PCHAR DestinationPath ; }MAINDATA, *PMAINDATA ; int main(int argc, char * argv[]) { PMAINDATA pData ; BOOL bQuwi ; DWORD dwIndex ; PCHAR pURL ; pData = (PMAINDATA)malloc(sizeof(MAINDATA)) ; … | |
| |
Hi, can you have a quick look at the two for loops here. I've declared the int 'i' in the first for loop but in the second for loop it doesn't recognise it and i have to declare it again. Why is that? [CODE]for(int i=0; i<x; i++) { cout << … | |
Hi guys. I am a bit confused among the following three functions. read() readAll() readLine() How do they work? I'll be really thankful to you all. Thanks alot for your precious time! Regards. | |
hi all, i am working now in code::blocks and dev c++,but in both the cases output is not coming in fullscreen.so,how to view output in fullscreen? thanks in advance | |
I was studying for an exam and came across two questions that me and my friends didn't know the answer to. We are given the answer but we just can't figure out what the answer is what it is. First, why does this code give an error? [CODE]int z=5, q=2; … | |
I am looking for fastest API to read/write files. Can you please help? I have checked such discussions here. But I am not able to figure out from those discussions. Please help. | |
1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 How To Print The Above Pattern ?? (Using For-Loops Only) | |
Here are program instructions. IT SAYS "segmentation fault" WHEN RAN. Specifications You must create a Ship class: The Ship class maintains the position data for each ship/vessel and its distance from another Ship. It has a default constructor, which sets all of the member data to zero, and a non-default … | |
my problem is that when I try and run it it says 'SortedList' : cannot instantiate abstract class due to following members: 'bool BasicADT::isEmpty(void) const' : is abstract ...and... 'int BasicADT::getLength(void) const' : is abstract can someone please tell me what I am doing wrong with my getLength and isEmpty. … | |
Hi, i want to write from one file to another. i managed to get the file to write but not in the way i expected it too, there is more to the program but for now i just need to know how can i mirror one file... My input file … | |
Just studying dynamic memory at the minute. I understand the idea of having dynamic memory for arrays so you can set the length of them within the running of the program. But what is the point of dynamic memory for a single type? If i set an 'int' up to … | |
Hello, I'm just wondering really.. I have a 2D matrix but I've defined it as a 1D matrix. So for example: [code] double *matrix = new double[N*M]; [/code] My question is, I'm going to be manipulating data very shortly and want to read this data in from a text file.. … | |
Hello, I joined about 5 minutes back. I need to complete my computer project, which is a hangman game in c++, by today. Based on what my teacher taught me, I have created a code that runs like this- [CODE]#include<iostream.h>//These are the only header files taught. #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> … | |
Hello everyone! I'm looking for a free (open source preferred) source code editor. Ideally it would be as light-weight as Notepad++, gedit, kate, mousepad, you see the pattern. However, the most important thing I'm looking for in this editor is flexible, dynamic, intelligent autocomplete (for c/c++). To be fair, Notepad++ … | |
This code is giving me runtime error. Here, first I want to take a integer input which determine the number (n) of nodes in the graph. Then for n-1 time I want take two integer input which will give the adjacency information. [CODE] #include <set> #include <map> #include <list> #include … | |
I have some code in C++ that uses an std::vector of std::strings to store an array of strings. I need to convert it into C. I thought that I would just create c versions of the functions I need (vector.back,vector.push_back,string.operator+=) but am getting lost in the double pointers. Can anybody … | |
Pls help me on this. I really dont have an idea of solving this. Here's the question .. 1. Write a c++ program that generates the following series: 0 -1 4 -9 16 -25 36 -49 64 -81 100 and also this one 2. write a program that generates the … | |
I was wondering if there is any way using the mingw g++ compiler to make code that acts like this: [CODE]#define myLanguageBlock(X) doMyLanguageBlock(#X) void doMyLanguageBlock(const char* code){/*this executes the code as if it were in another language, I have already written this function*/} int main() { myLanguageBlock( this is all … | |
hey guys, k, already 1 month I'm "leaving" my self-study on C++ for certain personal reason, I just learned the C++ two months before also, not much... I still can type in code and remember how most of the keyword works(that I learned), but I'm losing my ability to "think … | |
Hi Gurus, I have an assignment am doing. The user should enter details of 5 students and return results on the screen.I have the code below and its return 1 error. Can someone kindly help me.With regards #include<iostream> #include <string> #include <sstream> using namespace std; int main () { typedef … | |
I wrote a little program to read soma data from a *.txt file. The content of the file is "5 , 10, 15". The program shall identify the numbers, e.g. "5" and "10" and "15". This works until the last two numbers. Unfortunately the program doesn't read the last two … | |
So here is what i have done I did the basics of c++ and was quite comfortable with them Now i wanted to start with the allegro gaming library so i downloaded the library and linked it with my compiler i compile a program and it compiles fine but when … | |
So, as follows I have a basic while loop. It's working fine, however whenever I enter something other than a number or EoF, it goes through the loop one time after I'm wanting it to stop. Say I enter 5, then EoF, it enters an extra 5, so I have … |
The End.