51,593 Topics

Member Avatar for
Member Avatar for Kainan54

I'm starting to learn c++. I use vista so lots of ide's dont work for me. Right now im trying visual c++ but things like cout are not understood when compiling. This may be a compiler issue. I all would like to know is a good basic (for beginers) ide …

Member Avatar for Kainan54
0
124
Member Avatar for bids

[code] #include <conio.h> #include <graphics.h> #include <math.h> #include <stdlib.h> #include <dos.h> void serp(int level, int Ax, int Ay, int Bx, int By) { int poly[4]={Ax,Ay,Bx,By}; [COLOR="red"]setfillstyle(SOLID_FILL,YELLOW);[/COLOR] not working the way i want. if (level>0) { serp(level-1, Ax,Ay ,(2*Ax+Bx)/3,(2*Ay+By)/3); serp(level-1,(2*Ax+Bx)/3,(2*Ay+By)/3,(Ax+Bx)/2+sqrt(3)*(Ay-By)/6,(Ay+By)/2+sqrt(3)*(Bx-Ax)/6); serp(level-1,(Ax+Bx)/2+sqrt(3)*(Ay-By)/6,(Ay+By)/2+sqrt(3)*(Bx-Ax)/6,(Ax+2*Bx)/3,(Ay+2*By)/3); serp(level-1,(Ax+2*Bx)/3,(Ay+2*By)/3,Bx,By); } else fillpoly(2,poly); } int main(void) { int graphdriver=DETECT, …

0
64
Member Avatar for invisal

I am trying to make a simple engine with WinAPI and I encounter this problem: [code] class Window { .... public: [COLOR="Red"]static HINSTANCE hInst;[/COLOR] .... }; .... .... .... int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; [COLOR="Red"]Window::hInst = hInstance;[/COLOR] .... .... } [/code] The …

Member Avatar for invisal
0
245
Member Avatar for JustLearning

The function that I am having a problem with is in the middle of this seperated from the rest of the code. [code=c++] #ifndef GRAPH_H #define GRAPH_H #include <string> #include "queue.h" using namespace std; class FileOpenError // Exception class -- cannot open input file { }; struct EdgeNode // Structure …

Member Avatar for Lerner
0
669
Member Avatar for Puliver

Hi, I'm curently creating a command line tool in VC++ 2008 Express Edition for myself which requires reading many files and merging them together. Everything is OK and during debugging (F5) there is not a single problem, but at run time (ctrl+F5) a problem with fread occurs at the same …

Member Avatar for Puliver
0
474
Member Avatar for Kcube989

how can i make the computer block when im about to score, like do something like this XXXO? and how can i make the computer to make an OOOO for it to score too? im not allowed to use internet libraries in this one, need help

Member Avatar for Freaky_Chris
0
74
Member Avatar for fatnickc

I'm about to start writing a genetic algorithm program which will be able to find the highest/lowest/whatever else values of variables required for an equation, and have come upon a point about which I am uncertain. I do not know whether I should store and work upon the values as …

Member Avatar for fatnickc
0
120
Member Avatar for Jason123

I have a qns. How can i take out the number in a basic string input and assign them into different integer variable? Not a file input example - string input = "23/4/56" or "23.4.56" int a = 23, b=4, c = 56 [code==cpp] #include <iostream> #include <string> using namespace …

Member Avatar for ArkM
0
179
Member Avatar for chamaca24

I made this program but I need to figure out how to exit the program if the user does not input A,B,C,D, after three attempts. I'm new at building programs and I would be grateful for some help! #include <iostream> using namespace std; char studentAnswers(int); int main() { int i; …

Member Avatar for skatamatic
0
151
Member Avatar for Syrus_Jones

ok, i've got a question that i'm having trouble with Write a program that generates the factors of a number entered by the user. This program has the following requirements: 1. The user must enter a positive integer. If the user enters something else, your program should output an error …

Member Avatar for skatamatic
0
819
Member Avatar for Chaudharybilal

Hi i am bilal n i am new here i need to make a program on Human simulation....... Well what i need is a code. when i am executing a program like am printing 'x' for infinite many times during execution when the console is printing x infinitely what can …

Member Avatar for Chaudharybilal
0
126
Member Avatar for love_dude1984

hi everyone.. i just want to know which of following operator can't be overloaded. a)== b)++ c)?! d)<= hoping for a Answer ASAP with explanation.. thanks..

Member Avatar for MosaicFuneral
0
68
Member Avatar for SQ89

The sequence Fibonacci numbers begin with the integers 1,1,2,3,5,8,13,21....where each number after the first two is the sum of the two perceeding numbers, i want to write a loop to display this sequecnce numbers less than 500 . do we need to write 2 loops ? its not working for …

Member Avatar for ArkM
0
76
Member Avatar for nschessnerd

Hey all, I want to write a proxy for a local computer Basically i run a game server that talks [udp] to multiple people. However the server can be crashed. I want to write a program that captures the output of the server and sends it out on a different …

0
60
Member Avatar for laki234

ok .guys .i m sorry for my previous msg.Can anybody tell me how i can take user 's value,then divided into 8 groups and then i have to make node for that 8 values.Here is my code [ICODE] #include<stdio.h> struct node { long int data; struct node* llink; struct node* …

Member Avatar for MosaicFuneral
0
117
Member Avatar for wander4heat

Hi, Thank you for your support. I am new to C++ and have started working with classes. I understand constructors, accessors and mutators. I have a program that I am working on and I am implementing my classes. I have six classes and have completed four. The top two, Calendar …

Member Avatar for VernonDozier
0
105
Member Avatar for Blackout22

hey, this is my first time posting so please don't be too harsh ... I am trying to write a program that allows the user to play rock paper scissors against the computer. I am able to create the whole game ... but now i need to put different sections …

Member Avatar for skatamatic
0
121
Member Avatar for Trekker182

I'm new to link lists and have to write a few modified functions from the book to do additional things. I have to modify insert to insert by the 2nd number passed in and have it replace that position and move the number that was there up. It's inserting the …

Member Avatar for Trekker182
0
133
Member Avatar for minas1

Hi. I'm trying to overload +=, -= and *=. [code=C++] /*error C2297: '+=' : illegal, right operand has type 'Matrix *' error C2114: '+=' : pointer on left; needs integral value on right*/ Matrix* Matrix::operator +=(const Matrix *const m) { if(x == m->x && y == m->y) myArray::Add(ppMyArray, m->ppMyArray); return …

Member Avatar for ArkM
0
155
Member Avatar for dexter1984

Hi guys, I'm having some problem with my C++ assignment. Can't get this part down. [CODE=CPP] class Date { private: static const int daysInMonth[13]; int monthNo, year, day; string month; bool validDate, leapYear; public: void displayDaysInMonth(); void displayDate(); void enterDate(); void verifyDate(); void displayOptions(); void ahqError() {cout << "Error! Enter …

Member Avatar for dexter1984
0
121
Member Avatar for laki234

can anybody tell me what does this eroors mean: error C2676: binary '*' : 'class LongInt' does not define this operator or a conversion to a type acceptable to the predefined operator C:\Documents and Settings\dsproject.cpp(872) : error C2109: subscript requires array or pointer type C:\Documents and Settings\\dsproject.cpp(874) : error C2109: …

Member Avatar for ArkM
0
134
Member Avatar for mybluehair

i have a code that you enter section after section. when your done, you type end, and it stops asking you to enter in stuff. My problem is, I can get it to detect when I type end. here is my problem: [code] cout << "\n\n\nTo start, enter each section …

Member Avatar for skatamatic
0
110
Member Avatar for csaund1

Anyone have any idea how I would write a program that lets user input a floating point number and then either round up if number is like 4.5 our round down(truncate) if number like 4.49. Any help would be greatly appreciated.

Member Avatar for ArkM
0
187
Member Avatar for NinjaLink

This is my goal: - Search the list for a number and display how many times the number occur or display 'number not present' - Modify number and change each occurrence of a #, to the new number or display 'number not present' I have 2 functions. My first function …

Member Avatar for NinjaLink
0
203
Member Avatar for uw1

the following example shows the problem: "int* pointername = new int" followed by "delete pointername" - no problem. however: "int* pointername = new int[8]" followed by "delete pointername" flags`an error during execution. (compile/built are passing ok). This happens with 2 very different compilers: vc++ (native) and djgpp one. looks like …

Member Avatar for uw1
0
101
Member Avatar for Lukezzz

I get a problem when adding columns to a dataGrid. I keep adding columns with the code below. It works well until the column will come outside the right side of the dataGrids Widh. When it does, the program will get stuck for 2 minutes or so and the column …

Member Avatar for Lukezzz
0
80
Member Avatar for Raulin

Hi there.. I am currently making a snake game, by means of array set up of [50,50] of the snake, and the FLTK for the design of it's interface. As Quincy 2005 is the default IDE learnt in Univ, I do the c++ codings here. I already proceeded with the …

0
55
Member Avatar for ariesangel

for(i=0;i<9;i++) { x[i] = rand()%9+1; for(j=1;j<9;j++) { if(x[i]==x[i-j]); i--; } } pls tell me how the rand() function work. urgent. as soon as possible.

Member Avatar for ariesangel
0
160
Member Avatar for DanDaMan

Can someone please help me out? What are the pros and cons of C++ and Java? I've always been told that C++ is the ultimate programming language. It's powerful, fast, and used to run huge programs. But since Java is a close rival to C++, I was wondering what are …

Member Avatar for Rashakil Fol
0
135
Member Avatar for d1s_0n3_guy

Write a program that will prompt the user to type in a series of characters. Input these characters into a c-string (char array). For each character, if it is a letter, toggle the case (upper to lower case, or lower to upper case). All other characters leave as is. Print …

Member Avatar for d1s_0n3_guy
0
214
Member Avatar for mybluehair

I am creating a code, and I'm getting this weird error. I'm sure its a stupid mistake, but I can find it. [quote] multiple definition of `Start()' first defined here ld returned 1 exit status C:\Documents and Settings\Andrew\My Documents\projects\equation\Makefile.win [Build Error] [equation.exe] Error 1 [/quote] And here is the code: …

Member Avatar for WaltP
0
92
Member Avatar for matt91turbo

I need a little help to get me going on how to start this program. I know how to create a string array, but I'm having trouble getting the overall structure for this program. Any help or links to helpful sites would be appreciated. Write a program that will read …

Member Avatar for vmanes
0
210
Member Avatar for mybluehair

I have a c++ console program that alot of people are starting to download. But the program is updated around once a week. problem is, most of the downloaders never check for updates on the site. could add a feature to my program were it would do a check for …

Member Avatar for MosaicFuneral
0
105
Member Avatar for jlatorre80

Can someone please help me with figuring out why my codes does not run. I have tried to familiarize myself with how to get data from a file and discovered i need to use fstream. The data of the file is somethin like this: 19531029L 20081104L 19770615L 19300723L 19631122L 19410501L …

Member Avatar for MosaicFuneral
0
117
Member Avatar for Trekker182

I was wondering if anyone could offer some suggestions on how to validate a social security number & their employee # that a user would input separately through prompts? The SS# would be in the form of xxx-xx-xxxx where the x's are 0-9. I tried using this function that I …

Member Avatar for Trekker182
0
833
Member Avatar for Raulin

Hi there, I am currently doing the snake game for my c++ project. For your information, I am not majoring in computing or any programming course, but am majoring in Physics at Univ of Birmingham, UK. About my task, I employ the use of vectors as the main function to …

Member Avatar for Raulin
0
110
Member Avatar for Tchevalier

Im new to c++ and i'm tryin to compute the standard deviation of a set of floating point numbers using a data file. here I started my program and skip over things i didn't really know but can someone plaese help me. **************************************************************************** #include<iostream> #incluse<fstream> #include <cstdlib> #include <cmath> int …

Member Avatar for VernonDozier
0
204
Member Avatar for skatamatic

For a lab, my instructor asked us to include an assignment operator with our class, but to hide it. Does this mean to declare it as private and just leave an empty implementation? Is this common/useful?

Member Avatar for wt1099
0
313
Member Avatar for zothos

I have a problem with a code attempting to do a factorial of a number. For numbers 12 and below, the code works fine, but when I do 13 and above it outputs the wrong number. [icode] #include <iostream> using namespace std; int number; int number2; int main() { cout …

Member Avatar for MosaicFuneral
0
294
Member Avatar for afg_91320

i have this given structure: [code] struct Tempscale { double farenheit; double centigrade; }; struct Reading { int windSpeed; double humidity; Tempscale temperature; }; [/code] i am then asked: define a Reading structure variable is this ok: Reading data; write statements that will display following data: wind speed : 37mph …

Member Avatar for Ancient Dragon
0
396
Member Avatar for Evil Genius

Hi, I was coding the following program.. [ICODE] // Program takes work hours and rate per hour and gives total // salary after tax, if work hours are over 40, its increased by 1.5x. #include <iostream> #include <conio.h> using namespace std; int main() { double hr_work, hr_rate, taxed_total, total; cout …

Member Avatar for Evil Genius
0
134
Member Avatar for n3XusSLO

[CODE]std::string s="s1"; std::cout<<s<<std::endl; { std::string s="s2"; std::cout<<s<<std::endl; };[/CODE] Why can I have two variables with the same name existing like this?

Member Avatar for Lerner
0
192
Member Avatar for jlatorre80

Ok, well I am new to c++ and have been trying to get the basics down. I have a class assingment which require me to read numbers from a file and store them into a vector as long int. An example of the file would be : 19531029L 20081104L 19770615L …

Member Avatar for MosaicFuneral
0
134
Member Avatar for britishemo15

Hi everyone, basically i'm writing a simple program in c++ to trigger a beep from the internal speaker much like a musical keyboard except i'm having trouble with capturing key press how would i be able to trap a key press then initiate a beep, i have tried using kbhit() …

Member Avatar for MosaicFuneral
0
1K
Member Avatar for localp

i want to create a hash table ( independent rehashing ), using STL LIST... in Independent rehashing we use a function to we need to generate the index then check if there is any collisions if there is we need to rehash it and then put it in to the …

Member Avatar for Lerner
0
187
Member Avatar for laki234

hi. i have to do addition,multiplication,division and substraction of large numbers using c++. Using pointers and struct .I m sending some code.plz if anyone can do this program help me. here r some code plz send me on [email]fri_003@yahoo.co.in[/email] as soon as possible. [code=cplusplus] #include<stdio.h> struct node { long int …

Member Avatar for vmanes
0
98
Member Avatar for guest7

Hi, I am using the STL container for stack. <include> stack; I wish to check whether the integer is already in the stack or not before adding it into the stack. If it is in the stack then i do not need to add it. But if it is not …

Member Avatar for Lerner
0
72
Member Avatar for rhoit

I am new to the templates.. I was trying to implement templates in my x programs.... and i am stuck ... help me... problem is with the "search" function when i was not using templates search function was [B] Stack::Nodeptr Stack::search(char item)[/B] and worked perfectly fine.. when using templates... i …

Member Avatar for Lerner
0
172
Member Avatar for Vux

Is there a way for example, to use WGET, inside of a C program? I want to download the text of a website's index.html (ie [url]www.google.com/index.html[/url]) and then send it over to another program via sockets. Is this possible?

Member Avatar for vijayan121
0
790
Member Avatar for Lukezzz

I wonder for if I have a made a formapplication in VC++ 2008 Express Edtion that consists of 10 forms and I am for the moment writing code in Form10 and then want to compile and test the function. What I wonder is if I only can compile Form10 and …

Member Avatar for Lukezzz
0
89

The End.