49,757 Topics

Member Avatar for
Member Avatar for tKc

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 …

Member Avatar for daviddoria
0
166
Member Avatar for iarkey

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 …

Member Avatar for daviddoria
0
91
Member Avatar for beatenbob

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 …

Member Avatar for beatenbob
0
452
Member Avatar for Nathaniel10

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

Member Avatar for Nathaniel10
0
108
Member Avatar for vbx_wx

[code] int main() { const char* p = "Hello"; cout << sizeof(p) << endl; } [/code] Why this is 4 ?

Member Avatar for nbaztec
0
96
Member Avatar for gmfreak1991

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 …

Member Avatar for Fbody
0
171
Member Avatar for philipB

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 …

Member Avatar for Taywin
0
106
Member Avatar for tmantix

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 "/\|;:'><!@#$%^"...?

Member Avatar for tmantix
0
234
Member Avatar for chibon

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

Member Avatar for Fbody
-3
132
Member Avatar for centerline00

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 …

Member Avatar for Fbody
0
234
Member Avatar for enkidu75

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 …

Member Avatar for StuXYZ
0
166
Member Avatar for georgy9002

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 …

Member Avatar for StuXYZ
0
95
Member Avatar for fakiha erum

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

Member Avatar for Nick Evan
0
156
Member Avatar for atoivan

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

Member Avatar for atoivan
0
87
Member Avatar for jeffpro

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.

Member Avatar for arkoenig
0
105
Member Avatar for networkZombie

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 …

Member Avatar for jonsca
0
160
Member Avatar for ShontiD

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 …

Member Avatar for Ancient Dragon
0
143
Member Avatar for PinkyMV

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 …

Member Avatar for dexter321
0
3K
Member Avatar for gmfreak1991

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 …

Member Avatar for gmfreak1991
0
2K
Member Avatar for baconswife

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 …

Member Avatar for baconswife
0
249
Member Avatar for nickx522

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

Member Avatar for Nandomo
0
96
Member Avatar for MasterGberry

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 …

Member Avatar for Duoas
0
975
Member Avatar for Rickay

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

Member Avatar for Rickay
0
204
Member Avatar for Nathaniel10

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 …

Member Avatar for SgtMe
0
176
Member Avatar for keeda

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.

Member Avatar for myk45
0
84
Member Avatar for kyros

hello.I have an C++ assignment I have to find a path to exit from maze.I should read the maze from a file and write it to an array..but I couldn't do it.can you help me,can you give the code to do that and which headers should I include,please answer me …

Member Avatar for SgtMe
-1
376
Member Avatar for Vv IVIatthew vV

well, i'm writing a text-based game, and my 'NameEnter' function is acting up, basically, if you confirm that the name that you input is correct, it works fine, but if you type 'no' or something else, it doesn't accept the name reentry, i am not sure exactly what i have …

Member Avatar for SgtMe
0
144
Member Avatar for lynneh3979

I need to create a structure related to an overtime pay calculator and define the variables needed within the structure to do those calculations. Then define and create a base class using the same variables that may serve the same function as the structure This is as far as I …

Member Avatar for geethasree
-1
129
Member Avatar for russellquin

I'm new to c++ and I want a variable that represents fuel to stay zero even if/when the program tries to subtract from it. The problem is that sometimes it becomes a rather large number. I am guess that the variable is looping to the highest number that it can …

Member Avatar for Duoas
0
88
Member Avatar for Annettest

Hi everyone: I would appreciate some help with understanding how to free memory/use destructors. I have created a 2D dynamic array template class. I'm using Xcode and Xcode keeps crashing, with the message, "out of memory." Before I implemented this array class, I was using "new" directly within main() to …

Member Avatar for Annettest
0
2K

The End.