49,761 Topics

Member Avatar for
Member Avatar for namehere05

I have this code: in my judgement it should print 1 and 2, instead it prints 0 and 1 some advice pls... Im using dev c++ [CODE=cplusplus] #include <iostream> class A { public: A() { arr = new int[2]; } ~A(){ delete [] arr; } int * arr ; }; …

Member Avatar for VernonDozier
0
137
Member Avatar for Bemani_lover

I have my final due at 6 tomorrow and I need help on one tiny piece and it'll be finished. Here's what it needs to do. 1. When the program begins, it should ask the user to enter the seat prices for each row. The prices can be stored in …

Member Avatar for NathanOliver
0
127
Member Avatar for Talguy

Is there any way I can change the value of a template parameter inside the templated object or are these values constant. i.e. [CODE] template<int width, height> class matrix { ............ } void matrix<width,height>::setSize(int w,int h) { width = w; height = h; } [/CODE]

Member Avatar for Talguy
0
90
Member Avatar for fbutler24

Description This program is to be utilized by basketball coaches. The coaches will be able to input a player's points scored over a span of ten games and the program will then output the player’s average. Program Design. Declare PointsScored [10] of reals Declare sum, average as real Declare B …

Member Avatar for siddhant3s
0
125
Member Avatar for JLopeman

Hi all... For a project I have to create a small program that adds class data using templates. I've completed the project, but the output is not expected for the last cout in main. Here is the code: [code=cplusplus] #include <iostream> #include<string> using namespace std; template <class T> T add …

Member Avatar for NathanOliver
0
94
Member Avatar for frosty1979

i am using windows 7 and i am trying to setup a program but it is asking me to install visual c++ runtime i think i got the right one but it doesn't work can anyone help me out on this thanks

Member Avatar for VernonDozier
0
120
Member Avatar for Liszt

How would it be possible to check if a subKey exist in the Classes root in Registry Editor. My attemt is like follows but my compiler doesn´t like it. 'Microsoft::Win32::RegistryKey' : class does not have a copy-constructor no conversion from 'nullptr' to 'Microsoft::Win32::RegistryKey' [code] Microsoft::Win32::RegistryKey subKey1 = Microsoft::Win32::Registry::ClassesRoot->OpenSubKey("one\\two"); if( subKey1 …

Member Avatar for Liszt
0
368
Member Avatar for Adexter

Hi, Im working on a project for school and Im having a little trouble with one of my functions. I need a function to find the highest test score and a function to print the highest test score and the student that has it. The students first and last names, …

Member Avatar for Ancient Dragon
0
143
Member Avatar for Liszt

I have a big question that keeps asking me if it is a correct or good idéa to create a subkey on a users computer in order for a software to work. The software will create and check if that subkey exists in the below directory in order for that …

Member Avatar for Liszt
0
77
Member Avatar for NTxC

Hello. I'm currently having a memory leak problem in my program (C++ with MFC, VS2005) and I don't know WHY it happens, as the code seems to be OK to me. Anyway, here's the code that causes memory leaks: [code=C++]char* va( char* FormatStr, ... ) { va_list ArgPtr; char *FinalString; …

Member Avatar for NTxC
0
436
Member Avatar for 7eatsnine

hy to all members of Daniweb im a finance student currently taking computer programming course, im kinda shy to post it here actually coz im not good in IT nor programming. im really really new in C++, im having problem with my assignment. hope that all the seniors here could …

Member Avatar for 7eatsnine
0
155
Member Avatar for timb89

this is a homework task im completly lost in? we need to implement this header file below i like to think im pretty good at arrays and classes.... but the new additon of dynamic arrays has got me really confused... any help would be greatly appreciated [code] #include <iostream> using …

Member Avatar for ArkM
0
86
Member Avatar for astropirit

hello all, I am attempting to write a simple programe that will imitate pressing a button on a third party application. so far i have this: [code] // astro rocks BOOL CALLBACK FindButttonPush(HWND hWnd, LPARAM lParam) { if(GetDlgCtrlID(hWnd) == 1000){ *(HWND *)lParam = hWnd; return FALSE; } return TRUE; } …

Member Avatar for aces27
0
113
Member Avatar for Talguy

I am creating a matrix math library which I would like to give the user access an element in the NxM 2D array, that was allocated in the constructor. I've been reading that you can't overload the [][]. How would I be able to overload this overload this operator so …

Member Avatar for Talguy
0
105
Member Avatar for vaps

Hi I'm having a lot of problems with this project. [URL="http://rapidshare.com/files/231273948/project_programmeren01.rar.html"]http://rapidshare.com/files/231273948/project_programmeren01.rar.html[/URL] This is the source code in rar, because it's to much to copy-paste. Are there people who can solve those errors?

Member Avatar for vaps
0
80
Member Avatar for M'N'M

Please can anyone tell me why that program crashes when I enter the first matrix? [CODE]#include<iostream> #include <stdlib.h> #include <windows.h> using namespace std; void menu() { cout<<" \t\t\t\t*-*-UNIATIVE Matrix calculator-*-*\t\t\t\t "<<"\n"; cout<<" "<<(char)1<<" NNNN MMMM AAAA "<<(char)1<<" "<<"\n"; system ("color 08"); _sleep(1000); cout<<" \t\t\t *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\t\t\t"<<"\n"; cout<<"Ahlan washlan ya user Ya …

Member Avatar for tux4life
0
100
Member Avatar for newcook88

i want to read words form a text file and remove the comars and fullstops and then put the single word to a vector. but when i try the method below i get an error can some one please help me. [CODE]char delim[100]=",.`~!@#$%^&*()_+=-{}][:';?><|"; ifstream fileOne("file.txt"); string fileWord; while ( fileOne>> …

Member Avatar for tux4life
0
595
Member Avatar for JLopeman

Hi all - hope your weekend is going well. I've got the following code. It compiles, but gives a warning about a stack overflow error in the istream& operator function. When running the program, it just continuously outputs "Enter ID for student." What am I missing that makes this recursive? …

Member Avatar for JLopeman
0
239
Member Avatar for saravananrmca

I developed this application on C++ I am using 5X5 and 3X3 kernels to convolve with Image. As I know convolution is computational Intensive and I have to convolve many kernels with my image to achieve the result, the execution takes 2 seconds. I would like to reduce the processing …

Member Avatar for Salem
0
181
Member Avatar for k007

I am a novice user and am proposing to do a project on airline reservation system in C++ as a part of class. This is something I myself have proposed. I have started to design the classes and need some help. So far I have only created 2 basic classes: …

Member Avatar for k007
0
2K
Member Avatar for BlackStar

Can I have some idea's as to how to do that? Like say you have a piece of code that created n lists that are linked. Then you ask which node would you like to change the data? How would one do it? My Idea was the node contains N …

Member Avatar for BlackStar
0
494
Member Avatar for mostermand

Hi and sorry for the inconvenience I am trying to make an interface where a function is run given a number(windows API). I want a default function to be run if it hasn't been overwritten by the user. So my question is can i assign a number to a function/method …

Member Avatar for mostermand
0
146
Member Avatar for bernadlosini

i have to read input from .sql file .but that file name should be read from command line instead of cin.how to do that command? if my file t.sql ,how it would be? i tried like this but i couldnt get the output int main(int argc, char* argv[]) which file …

Member Avatar for tux4life
0
137
Member Avatar for teddycow

I'm having some problems with my code: [CODE] int a, b,x, c, d, cdnr ; char songname[4][3000][30]; char sok[4], avsok[30], cdtitel[4][30], r[30], i; { ifstream array2; array2.open ("array.txt"); array2 >> i; for(a=1;a<=i;a++){ array2>>cdtitel[a]; array2>>r[a]; for(b=1;b<=r[a];b++) array2>>songname[a][b]; } array2.close(); } for(a=1;a<=i;a++){ cout<<cdtitel[a]<<endl<<endl; for(b=1;b<=r[a];b++) cout<<songname[a][b]<<endl; }[/CODE] My text file: [CODE]3 AAAAAAAA 2 …

Member Avatar for tux4life
0
100
Member Avatar for bernadlosini

im given an very tuff assignment like this a. Introduction we have read all input from q sql file.the name of sql file should be read by a command line.please any body help me to do? i tried some. support of SQL of your ADT table to CREATE TABLE, DROP …

Member Avatar for bernadlosini
0
2K
Member Avatar for kiske

Hi, I have a function in VB6 like this: [CODE]tot = CLng(tot Xor Not lngdata)[/CODE] I'd like to do the same in c++, but I can't get the same results... I've tried like this: [CODE]tot = (int)((-1) * (tot ^ lngdata) ); [/CODE] But I don't get exactly the same …

Member Avatar for ArkM
0
242
Member Avatar for sabian4k

I have to take in a number that is bigger than one digit and put them into an array and give each digit it's own place in an array. then I guess i have to create an array with those same digits to an int. lol how? haha [code] // …

Member Avatar for tux4life
0
91
Member Avatar for l3vi

Been developing for years under web based services like PHP and SQL, and I thought it would be a good idea that I come back and learn C++. Been enjoying it, but I got this one thing that is just driving me nuts. In the do while loop after the …

Member Avatar for l3vi
1
1K
Member Avatar for SallyJ

Hi I need help with a function to determine if a triangle is a right angled triangle when three points are entered. Hers's what I have so far, it's the function at the bottomthat I struggle with: #include <iostream> using namespace std; struct pointType { int x; int y; }; …

Member Avatar for ArkM
0
2K
Member Avatar for hammans

#include<iostream.h> #include<conio.h> #include<graphics.h> #include<dos.h> union REGS i,o; struct SREGS s; initmouse(); showmouse(); void changecursor(int *shape); int cursor1[32]={ 0x0000,0xf00f,0xe007,0xc003, 0x8001,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x8001, 0xc003,0xe00f,0xf00f,0x0000, 0xffff,0x0ff0,0x1ff8,0x3ffc, 0x799e,0xf99f,0xffff,0xffff, 0xffff,0xffff,0xffff,0x7ffe, 0x3c3c,0x1ff8,0x0ff0,0xffff, }; int cursor2[32]={ 0xe00f,0xf10f,0xf81f,0x8c63, 0x0001,0x0001,0x0001,0x0001, 0x8003,0xc007,0xc007,0x8003, 0x8003,0xc7c7,0xffff,0xffff, 0x1010,0x0820,0x0440,0x739c, 0xfbbe,0xfffe,0xfffe,0xfffe, 0x7ffc,0x3ff8,0x3ff8,0x7ffc, 0x7d7c,0x3838,0x0000,0x0000, }; int cursor3[32]={ 0xffff,0xffff,0xffff,0xe03f, 0xc01e,0x800c,0x0801,0x8001, 0xc003,0x8003,0x0001,0x8009, 0xc01c,0xe03e,0xffff,0xffff, 0x0000,0x0000,0x0000,0x1fc0, 0x3fe1,0x7ff3,0xf7fe,0x7ffe, 0x3ffc,0x7ffc,0xfffe,0x7ff6, 0x3fe3,0x1fc1,0x0000,0x0000, }; int cursor4[32]={ …

Member Avatar for MosaicFuneral
0
117

The End.