49,761 Topics
| |
Good evening guys.... i'm newbie in here and in c++... while i in the middle of pratice in making program... i try to make a stack that can check whether the string that user input is palindrome or not. i'm using visual studio 2010 and get autos error this is … | |
I am completly lost on this could someone point me in the right direction into where I am going wrong with this code. [CODE]#include <iostream> using namespace std ; int main() { int x ; int y ; int temp ; int remainder ; // read in the two integers … | |
i made a test program, this line " *ps.Working_Hours=10;" generates mistake. why ? [CODE]#include <cstdlib> #include <iostream> using namespace std; class Salary { public: int Working_Hours; float hour_rate; float x; }; int main(int argc, char *argv[]) { Salary s; float yy; s.Working_Hours=7; s.hour_rate=30.5; Salary* ps; ps=&s; *ps.Working_Hours=10; cout << "s.hour_rate=" … | |
write a pseudocode algorithm tp prompt the user to enter a number and it should tell if the number is odd or even.........i need help | |
am new to c++. i want to create a desktop application but i don't know how to create a user interface-forms like vb.ne forms using dev c++ IDE. how do i go about it. | |
I need help in using 2d arrays in c++. I want to output a table that looks like this 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 … | |
Ok i've got this simple code to encrypt a msg with a private key. When i run the app it crashes. Any help? [CODE]#include <stdio.h> #include <string.h> #include <openssl/rsa.h> #include <openssl/pem.h> int main() { char keyy[] = "Private key here"; unsigned char *key = (unsigned char* )keyy; printf("%d\n",sizeof(keyy)); RSA *public_key … | |
I'm trying to write a program which uses 4 class files. However, I've got some issue regarding the error I got from cygwin using g++ command, it says Calling fdopen: bad file descriptor when I try to include the files I need on top of my header files. I'll show … | |
Is it possible to have an array as a class member? It is part of my Wumpus Hunt exercise. I want to do the following: [code] class Room { blah blah; }; int main() { for (i = 0; i < 3; i++) { Room adjacent[i]; blah blah; } [/code] … | |
[code] int main() { const char* p = "Hello"; cout << sizeof(p) << endl; } [/code] Why this is 4 ? | |
Hey, I'm writing a wheel of fortune game and trying to figure out how to make the game update what players turn it is. It is assumed that there is only three players, and the variable "int players = 1" is defined globally, so if I change it in the … | |
My teacher has given me an assignment to parse a text file that contains no more than 25 "Students" the Student object has a Name, and five grades contained within an array. Now, I've set up the Student file, the Array template file per his instructions and i'm reading in … | |
Hey, This is probably a newb question, but what all can a string type variable hold? Is it restricted to just letters or can it hold things like "/\|;:'><!@#$%^"...? | |
Hello all i need help with my school project which is to create c/c++ program to demonstrate the AI problem of coloring the Australian map With Forward Checking, i Kind off dumb when it comes to c/c++ anyone can help me with the source code? Thank You | |
O.K., I have a project I'm working on. It uses 8 classes (I'm only showing 2 and main). It gives me a "bad_alloc" error when the obj is instantiated. When obj is removed it works fine (or call the personType class that "should" be inherited from extPersonType.) Any thoughts of … | |
I am making a program for my class where I handle equation problems such as: 2a-3b+5c=10 3a-2b-3c=-5 where the answer would be: 5a-5b+2c=5 This is what I have so far. It still isn't perfect cause I still haven't figured out the "=" part. I do have it performing the math … | |
Hi could someone help me with my existing code !? I need Write an OO program using two Classes to create a guessing game in which the user must guess a number between 1 and 100 . The user is given a maximum try of 10 tries to guess each … | |
sir i am being given a task to make a program which evaluate the fictorial of a given number, using loops. please guide me who i could do this | |
i need help with a program i am writing a in c++ and Java .a program that when i input a figure like 2345 it will sum the figure up by adding 2+3+4+5 can any one help some one give me some code int a = 0 int i = … | |
I have a program that works on Windows XP but when I try to run it on Windows 7 I get this error. Debug Assertion Failed! File: c:\program files\microsoft visual studio .net 2003\vc7\atlmfc\include\atlcomcli.h Line: 148 Expression: p!=0 I've googled for hours. | |
I have to write a program for computer science that takes in the total amount of goods your buying and what amount your paying with and then outputs how much change you will receive. So for example your buying something for $3.99 and you have a $5 bill then it … | |
Using Visual Studio 2008...My assignment is to use the file SalesData.txt to load an array of structs, and use the array of structs to show to the screen a control-break report which breaks with each change in salesperson and shows each salesperson's total sales. I have not finished but I … | |
Hi all, I'm new to programming and I am currently taking an intro class that is requiring me to create Wheel of Fortune in c ++. I've made some decent head-way (I think), but I'm still far from getting this right. Here's what I have so far: *NOTE* The function … | |
Hey i'm doing a project, and i'm at the part where the user must enter a phrase or sentence and it must be compared to the phrase or sentence already imput to the computer via file. I'm asking a user to enter the sentence / phrase using cin.getline, but when … | |
Hello, for some reason I am having trouble remembering how to make it exit when they push the number 9. Can anyone help me? Also, I need it to repeat rather than at the end saying "press any key to continue" I know I will do this using while (choice … | |
I cannot quit after the program went to loop and if user choose not to continue game 'n' the program keeps asking for new guess. heres the code [CODE]#include <iostream> #include <iomanip> //#include <stdlib> #include <ctime> //or <ctime> using namespace std; int main() { //local constants const int MAX_NUM = … | |
Hello. I am trying to store information in a structure using this pointer loop method. If i try using the getline() method it seems to crash the program, and without it crashes if i enter more then 1 word. Also when the last loop deleting the pointers goes off it … | |
[CODE]int main2() { cin.get(); cin.ignore(); cin.clear(); while(true) { long double x, y; char ch_op; Sleep(200); cout << "Enter an expression below: \nExamples:\n"; cout << "x + y for Addition.\nx * y for Multiplication.\n" << "x / y for Division\nx - y for Subtraction.\nx & x for Square Roots.\n" << "x … | |
Stroustrup has an exercise in which the reader writes a program for the wumpus hunt game. A first draft of my code is below. It compiles and runs partly correctly. If you choose to move to a different room the program runs as expected. If you choose to shoot at … | |
Hi, What could be the most efficient algorithm(time/memory wise) for the below problem? Q: create an array of unique elements from a given array? Thanks in advance. |
The End.