49,758 Topics
| |
I'm creating a Sudoku game, and according to the rules of Sudoku, there cannot be the same number in any row or column. My question is this: How do I compare a value with an entire row or column in an array? For example: I have a 9x9 array that … | |
Hello this problem is from the beginner book C++ Primer Plus 5th edition.. The problem sounds something like this: Write a short program that asks for your height in feet and inches and your weight in pounds(Use three variables to store the information). Have the program report your body mass … | |
I am suppose to use arrays where i read in data from a text file and i have to set these functions to it. any clues on how i would approach it. my main concern is how to read data from a file using class while using arrays. i know … | |
i am having errors when i compile this code such as: main_class.h(31) : error C2228: left of '.x' must have class/struct/union 1> type is 'float' main_class.h(31) : error C2228: left of '.y' must have class/struct/union 1> type is 'float' main_class.h(31) : error C2228: left of '.z' must have class/struct/union This … | |
i convert some opengl code from visual c++ 2006 to visual c++ 2010 i mean visual studio framework. problem is in visual studio 10 they r running but mainloop is not working, i mean windows r supposed to wait for key input but it shows and gone at instant. no … | |
hi guys!! i'm just new in programing and i had a problem in c++ my prof give me a task... i need to make a program that looks like a casher system or restaurant system... i don't know howto start it..... so please HELP me!!!!! :(( | |
Im supposed to sort a file in decending order using bubble sort into an array. My code does all of that but it repeats the sorted array 50 times instead of just listing it once. This is a C ++ file on Dev. Thanks for your help, it's due midnight … | |
Hi guys, I am looping through an array to print the values I entered in another loop before. The first method (showNombre()) returns a char array, the second one and Int. Problem is my second one showEdad() is returning the address of the int and not the value entered before. … | |
All right this is easy and for some reason im having trouble. Im workng on a Pig Latin program but right now all I want help with is getting an entire sentence to print out. I first tried to do this [PHP]char pig_latin() { char sentence[100]; printf("Enter a sentence\n"); scanf("%s", … | |
A magic square is an N by N array of integers. The sum of the values of each row, each column, and the main diagonals are equal. Write a program that reads the size of a square, then each row, and verifies if the square is a magic square using … | |
Hi, I have a question regarding VB and VC++ connectivity. Can a program, written in C++/VC++, take input from a module written in VB? Someone please help me..... | |
hi i have a class with a member which is a pointer to an object on the heap. (the object is created from outside the class and is passed to it as a reference in the constructor). when i try to access it from void functions, everything is ok. but … | |
I'm just wondering if someone could point me to some sources on linked lists. I'm trying to make it so the user inputs how many they want to add to the list and the list will stop after that amount. I'm just looking for some examples on it to help … | |
What is worng with this code? This code shows... setw.obj : error LNK2005: _main already defined in filel.obj Debug/filel.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. filel.exe - 2 error(s), 0 warning(s) [CODE]#include <iostream> using std::cerr; using std::cout; using std::endl; #include <fstream> using … | |
Okay, so my assignment is to overload the following operators and use them in main: +, -, *, /, ==, !=, >, <, <=, >= and these friend functions: >>, << Now, for the assignment our instructor gave us a program with a completed header file, main, .cpp, etc for … | |
I'm having a little bit of trouble. I have been working on this code for a while and no matter what I do I just can't seem to align the data correctly. I can really use some help. The information for the stocks and the output of the program is … | |
Hey guys, it is possible to program a speech recognition in C++ without the Microsoft Speech SDK? | |
As an assignment, I have been ordered to program the game Breakout/Arkanoid. We have to implement a class hierarchy starting with an Entity. We then expand this class to a PlayerEntity and an EnemyEntity. Then PlayerEntity is expanded to a PlayerBall and PlayerPaddle. EnemyEntity is expanded to EnemyBlock and EnemyProjectile. … | |
[CODE] #ifndef HYS_MAIN_HEADER_H #define HYS_MAIN_HEADER_H #include <windows.h> #include <windowsx.h> #ifndef HYS_GLOBAL_VARIABLES #define HYS_GLOBAL_VARIABLES namespace hys { const short Null = 0; const bool True = 1; const bool False = 0; }; #endif // HYS_GLOBAL_VARIABLES #endif // HYS_MAIN_HEADER_H [/CODE] I want to avoid using macros as much as possible (C++ … | |
ok here is my project here so far: Main.cpp #include "Library.h" void main() { //GENERIC WECLOME SCREEN cout <<"\n\nWelcome to Hollow's Eye\n"; cout << "<Programmed by Ethan Rigel>\n"; cout << "Hollow's Eye a once bountiful and gorgeous land but alas; the\n"; cout << "Mighty Dragon has destroyed and ravaged our … | |
I'm having some trouble outputting a 2D vector as a grid in the Terminal. What I've done is create a class [ICODE]Grid[/ICODE] that creates a grid (in this case, a square grid), by creating a set of x and y co-ordinates whose spacing is [ICODE]dx[/ICODE] and [ICODE]dy[/ICODE]. I can then … | |
hello to all. can anybody say that what is "..." operator in c++?? is overloaded operator? my teacher say that ... is a c++ operator!! (sorry for bad English, is not my firs language :P) | |
Hey all, I'm doing a project to create an address book which uses a binary search tree (AVL node) structure to store, search and sort the data. There are 14 main fields for each address contact. All fields can be represented as strings. The 14th field can have unlimited entries. … | |
Problem stated: Write the function flip_lines(). Open the input and output files file using the parameters. Return true if both files can be opened and processed, false otherwise. If both files can be opened, write each successive line of output in reverse order. (In other words, switch line 1 and … | |
Sorry but I'm having a problem whit this function that is meant to let me edit records in a binary file. After I enter what I want to change an attribute to the file remains unchanged. [CODE]void updateStudent(fstream & file) { S students; long lenth; char snum[10]; char editChoice = … | |
New to C++ but can read it I need to break out a string sent via the serial port. The string :"N,1,2,3,4,5,6" I figure if I can load the string into an array then I can refer to each item via the index. EG: Myarray[0] should hold "N" | |
Is there any drawbacks for using "this" pointer? For example: [CODE] Window_Properties::Window_Properties(wchar_t* wnd_title, wchar_t* wnd_class_name): window_width(1280), window_height(720), window_X(0), window_Y(0) { this->window_title = new wchar_t[ wcslen( wnd_title ) ]; if( this->window_title ) { wcscpy( this->window_title, wnd_title ); } this->window_class_name = new wchar_t[ wcslen( wnd_class_name ) ]; if( this->window_class_name ) { wcscpy( … | |
Hello everyone! I'm writing a program to evaluate an infix expression(for example: 1.5*(2-3)+(4.5-4)). To do that I'm using function void infix2postfix(char* infix, char * postfix, int insertspace) to convert an infix expression to the postfix one (for this purpose I'm using a stack to hold operators of infix expression); then … | |
Hi, i have no idea how to go about doing this iv tried coding it a bit but just get very confused! if anyone could give me a hand or show me some sample code would be great. Thank you Create a program which: Implements a class called Queue: The … | |
Guys, I really really need a hand on this simple problem that I think, for me, is a really really big problem. I'm using the compiler turbo C. I have all the codes working except that it does not go back to the main menu. Can you please check my … |
The End.