49,756 Topics

Member Avatar for
Member Avatar for vladdy191

I'm looking at this code and I'm not sure what it prints (I don't have a C++ compiler to run it). However, I also would like to understand why it prints what it does? hope someone can help, here's the code: [CODE] class A { public: virtual void p() { …

Member Avatar for dougy83
0
132
Member Avatar for akira_shinizaki

How we can make a nice table in C++ ? I always use "|" and "___" to manually create a a table, but it often messed up. Please give me some tutorial and if possible table's screenshot. Thank you as always^^.

Member Avatar for Agni
0
89
Member Avatar for akira_shinizaki

Hallo everyone, I have some problems with my assignment. I asked to provide some error-handling in my program. What I want to ask abou how we handle an input that isn't its type. For example i define a variable int a but we "accidentally" input a string or other type. …

Member Avatar for ArkM
0
70
Member Avatar for san_sarangkar

Could u please tell me , how to create webpage through Dev C++ and write output on webpage ?

Member Avatar for TheBeast32
0
61
Member Avatar for imput1234

How do I set a fixed number of places. for example I want 1 to be 01. this is what I've been trying, but never works for some reason. Does anyone know how to do this. Thanks. int i = 1; cout << setprecision(2) << 1 ;

Member Avatar for imput1234
0
62
Member Avatar for akira_shinizaki

How we can limit input data ? For example we only want the user to input 4 characters, user only can write up to 4 characters. Thank you fot your help.

Member Avatar for Lerner
0
262
Member Avatar for OhItsThatGuy

Hey guys im new to C++ so if this is an dumb question all apologies. Whats going on is i am comparing a user entered major with one from a structure of information on students (name,hours,gpa,etc..). for this im trying to pull out majors in example say someone was a …

Member Avatar for ArkM
0
168
Member Avatar for scotchfx

The following test code compiles and executes correctly: [code=c++] class RegExpTest : public Framework { template <class T> int reParseNumbers( std::string, std::set<T>&, double=-1 ) throw(Exception ); } template <class T> int RegExpTest::reParseNumbers( std::string s, std::set<T> & numSet, double set_size_limit ) throw( Exception ) { // do some regular expression stuff …

Member Avatar for StuXYZ
0
185
Member Avatar for DLightman

I am gettin this compile error and for the life of me cannot figure it out: [CODE] BinarySearchTree.h:22: error: type âintâ is not a direct base of âBinarySearchTree<int, int, std::less<int> >::BinaryNodeâ [/CODE] This is the header file file the error refers: [CODE=cplusplus] #ifndef BINARY_SEARCH_TREE_H #define BINARY_SEARCH_TREE_H #include <cstdlib> #include <functional> …

Member Avatar for DLightman
0
125
Member Avatar for alex5161

Could someone help me understand what is going to be returned in following piese of code and why (the processing logic) (I have no way to compile it by myself now....) [CODE=C++]struct A { int value; virtual int access() { return this->value; } }; struct B { int value; virtual …

Member Avatar for ArkM
0
119
Member Avatar for LustrousWS6

I have googled the error and found nothing. This is the last bug I've been trying to work out and the only I haven't been able to figure out. Thank you for your time. I'm currently trying to test out a standard simple linked list class. I'm currently trying to …

Member Avatar for StuXYZ
0
98
Member Avatar for Fouly

Hi all, The following code is generated automatically in Microsoft c++: [code] // InventoryAssignment(BETA).cpp : main project file. #include "StdAfx.h" #include "Form1.h" using namespace InventoryAssignmentBETA; [STAThreadAttribute] int main(array<System::String ^> ^args) { // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); // Create the main window and …

Member Avatar for Fouly
0
111
Member Avatar for koushal.vv
Member Avatar for koushal.vv

Hi, i am using CMsFlexGrid in my project. the problem i m facing is the alignment of data ie when i store integer, double its getting aligned to right when i store strings its getting left aligned pls help. Display look very horrible :( .how to change it i dont …

0
101
Member Avatar for Ahmed_I

Generic Double Linked List [CODE="C++"]/* These are generic Functions for a Generic List * Note:-Only Functions not including a Menu and an Interface * You could use these Functions for your own Benefit*/ #include <iostream> using namespace std; template <class X> struct node{ //Template Structure X data; node* next; node* …

Member Avatar for ArkM
0
189
Member Avatar for ohnomis

Hello, I'm writing a a program in C++ that adds/subtracts complex numbers. I'm having trouble writing the square root of -1 or "i" in a complex number. Complex number: realPart + imaginaryPart * i (where i is /-1) ["square root of -1"] so far I'm thinking the code is something …

Member Avatar for ohnomis
0
852
Member Avatar for Fouly

Hi all, I added a class named RandomVariableGenerator with the following functions in the .h file [code] static double GetRandomNumber(void); static double GetExponential(double beta); static double GetUnifrom(double a, double b); [/code] but after building them i got the following errors: Error 1 error LNK2020: unresolved token (06000002) RandomVariableGenerator::GetRandomNumber Error 3 …

Member Avatar for Fouly
0
162
Member Avatar for deusieeee

I have a assignment that we are to write two clases (Ballot, Votes). We are to use an array of Ballot type to hold information for each particular Ballot. The Votes class is used to mark the ballots, count up all to votes, delete a ballot etc. I have the …

Member Avatar for omeralper
0
612
Member Avatar for leowdeo

[CODE]am trying to login to a server, say my gmail account by sending it my username and password in a typical POST request. to make my life simpler i tested this code on www.campuser.net i was able to see the pages http requests using a firefox addon called tamper data …

Member Avatar for Paul.Esson
0
158
Member Avatar for Fouly

Hi all, I used a function called GetRandomVariable to return a double data type and here's its code: [code]double GetRandomNumber(void) { // Zi = (AZi-1 + C)(mod m) // Zi = (5Zi-1 + 3)(mod 16) RandomVariableGenerator::Znode = (double)((5.0*RandomVariableGenerator::Znode + 3) % 16); return RandomVariableGenerator::Znode/16; } static double Znode = 7.0; …

Member Avatar for Fouly
0
153
Member Avatar for AutoC
Member Avatar for AutoC
0
4K
Member Avatar for 666kennedy

i have an array weights[16][60] this being 16 rows of 60 elements in each one i have another error[16] which co incides with each with the 16 rows, this is the error from each row. is there a way i can put each of the 16 in order in the …

Member Avatar for 666kennedy
0
182
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}; setfillstyle(SOLID_FILL,YELLOW); 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, graphmode; initgraph(&graphdriver, &graphmode, ""); int i, …

Member Avatar for bids
0
140
Member Avatar for emotionalone

I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent …

Member Avatar for cikara21
0
215
Member Avatar for Alex Edwards

In C++, where are the header files that define the standard primitives and bitfields? I would like to confirm something, if it is possible. -Alex

Member Avatar for ArkM
0
174
Member Avatar for MylesDBaker

Hello, I am trying to declare a 2D array (3x3) inside of a class. I have it set up like this: GameBoard.cpp[CODE] #include "GameBoard.h" #include <iostream> using namespace std; char board [3][3]; GameBoard::GameBoard() { board [0][0] = 'a'; board [0][1] = 'b'; board [0][2] = 'c'; board [1][0] = 'd'; …

Member Avatar for ArkM
0
148
Member Avatar for CoolGamer48

Does anyone actually use the .hpp file extension for C++ header files? I've never seen it used, but I was just working with geany, and I noticed that it only syntax highlights C++ specific things if the file extension is .hpp (or .cpp, obviously, but not .h). So what's the …

Member Avatar for ArkM
0
135
Member Avatar for vahny

[code] #include<iostream.h> int main() { int row1[10]; int col2[10]; int m,n,p,q; cout<<"Enter the number of rows in matrix A"<<endl; cin>>m; cout<<"Enter the number of columns in matrix A"<<endl; cin>>n; cout<<"Enter the number of rows in matrix B"<<endl; cin>>p; cout<<"Enter the number of columns in matrix B"<<endl; cin>>q; if(n!=p) { int …

Member Avatar for cikara21
0
176
Member Avatar for Icebone1000

Hi, i was tring to figure how set display mode to fullscreen under win2000, i saw at msdn that theres a SetConsoleDisplayMode, but that is for winXP +.. I tried [CODE] //sets the console window //to fullscreen void FullScreen(){ HANDLE consolehandle; int sysmetrics_x=GetSystemMetrics(SM_CXFULLSCREEN);//get full width int sysmetrics_y=GetSystemMetrics(SM_CYFULLSCREEN);//get full height COORD …

Member Avatar for marco93
0
167
Member Avatar for NinjaLink

Hello, I'm having a simple problem. For my program, each song has an id number which stores the songs information. For my deleteSong function, I am asking the user what id of the song does he/she wants to be deleted. After the user enters the id of the song he/she …

Member Avatar for NinjaLink
0
143

The End.