51,593 Topics

Member Avatar for
Member Avatar for Lukezzz

I use this random generator for numbers but it seems that this generator isnĀ“t really random because it seems to generate the same "Random" sequence chain every time I restart the application. Is there a better way to generate random numbers than this, that is more random ? [code] for( …

Member Avatar for Lukezzz
0
225
Member Avatar for Greeny28

Hi, I was hoping someone could correct my mistake. I'm trying to store references (or pointers should that be better) in a hetrogenous List. (The references or pointers will point to mixed classes). The problem is that everytime I store the pointer which holds a reference to the object, the …

Member Avatar for Narue
0
141
Member Avatar for meistrizy

Thanks in advance for your help. My code is doing some weird things and I can't figure out why. The purpose of my program is to have the user input any number and get the day of the week, month, day, and year and if that year is a leap …

Member Avatar for meistrizy
0
128
Member Avatar for Seamus McCarthy

Hey, i set up a circular queue to sort and pass ints easy, but having problems passing struct of information to the queue, wat declaration should i pass to insert function?? Here is my code so far, what would i change the int item to in insert function?? have just …

Member Avatar for Seamus McCarthy
0
162
Member Avatar for Rajesh1978

Hi, I am a computer professional. I have 3 years of experience in C++ on financial domain. I did not get a chance to work in networking domain. When I go for any change people are asking about the Networking domain and IPC programming. How can I master that though …

Member Avatar for Ancient Dragon
0
121
Member Avatar for mnkdpatel

I am studying C++ programing and i have a assignment which create a maze, which is a two dimensional array of size entered by user and the density also entered by user density is percentage of obstacle in the array. one mouse enter from the bottom of the array from …

Member Avatar for iamthwee
0
79
Member Avatar for drunkenmonk

I am writing a program to manipulate a stack containing integers using push, pop, print, etc. The only thing I have left is to write a function called copy. Here is what I've tried so far: [CODE] void Stack::Copy(Stack otherStack) { otherStack.top = top; for (int ii = top-1; ii …

Member Avatar for drunkenmonk
0
3K
Member Avatar for Akis2000

hello, i have a double value=0; and i want before starting the calulation to round this value in the numbers that the user add, for example 2... any ideas??? I have despered...........

Member Avatar for Akis2000
0
143
Member Avatar for kailisr

//I am having problem with the final portion of my program; it is for a class. //This is what I have so far, and the exact instruction I have for final part are: //Finally, modify the above program to read the numbers in from a text file (numbers.txt), write the …

Member Avatar for kailisr
0
102
Member Avatar for lukeriverplate

I am trying to input a data file into C++ such that it will appear as 2 arrays of maximum value 100... so far, this is what I have... void readfile(double x[], double y[], double sigma[], int * entries) { /* read data into x[] and y[] fill sigma[] with …

Member Avatar for s_sridhar
0
152
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
138
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
136
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
91
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
128
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
100
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
122
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
146
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
83
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
449
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
159
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
87
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
116
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
108
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
88
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
103
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
601
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
241
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
184
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
505
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
149
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
157
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
105
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
245
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
93
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
120
Member Avatar for Playtner

Hi, I've been trying to create program that can access a binary file with a vector in it without first saving it to the file. If I just try to read from the file without saving something, the vector will have information in it but when I output it to …

Member Avatar for Playtner
0
93
Member Avatar for MicrosoftMahmou

hi every one, As I said earlier i am very very beginner in c++ and programming in general .Then,I hope you bear with me and help me. in pointer: if i definition a pointer as integer ********************************** int **p = new int*[M]; for ( int i = 0; i < …

Member Avatar for MicrosoftMahmou
0
82
Member Avatar for nishantsharma

Hey guys Am working on this program, a part of which requires the input fixed-point binary number to be converted to decimal for example; 11001.101 to its equivalent mixed decimal number...........any suggestions(a function would be excellent :) )?

Member Avatar for tux4life
0
242
Member Avatar for arpeggio54

Hello, I am in school programming a game using SDL. It's a simple game where the player shoots at ships, which spawns randomly. For this I call random function rand() each time in the game loop, then using the modulus operator to determine wether a new enemy will spawn. The …

Member Avatar for Narue
0
88
Member Avatar for Poab9200

Ok, first things first. Hello everyone, I have a question. How would I go about adding Shortcut Arguments to my program(Code shown below). My idea: I play a game called [I]Counter-Strike:Source[/I] and recently I've needed to gather all the names of custom maps added to the \map directory. To the …

Member Avatar for ddanbe
0
261
Member Avatar for shaynerossum

I am in the progress of trying to write a C++ (Visual C++ compile) program that dynamically reads in files from a series of sub directories that the user inputs. I am trying to catenate several strings together to prevent to many input request from the user. I could probably …

Member Avatar for shaynerossum
0
162
Member Avatar for norulez43

Hello, I have a program that splits up a single .txt file into separate files (one per sales rep). The original text file has a layout that used to be printed on wide tractor feed paper. I am saving these output files as .doc's. My only problem is that, when …

Member Avatar for ArkM
0
161
Member Avatar for Deme

Well, what i'm trying to do is use cin.getline with my char pointer of 255 characters, take a look at the code below: [CODE] #include <cstdlib> #include <iostream> #include <fstream> #include <conio.h> using namespace std; char * pChar[255]; pChar = new char[255]; void newPointer() { delete pChar; pChar = new …

Member Avatar for Deme
0
2K
Member Avatar for OffbeatPatriot

I configure it like this ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --enable-unicode --with-opengl and when I build it I get this error. /cygdrive/c/wxwidgets-2.8.10/bk-deps g++ -c -o baselib_appbase.o -D__WXMSW__ -I./src/regex -DwxUSE_GUI=0 -DwxUSE_BASE=1 -D_FILE_OFFSET_BITS=64 -D_LAR GE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxwidgets-2.8.10/lib/wx/include/msw-unicode -debug-static-2.8 -I./include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ./s rc/common/appbase.cpp In file included from ./include/wx/memory.h:16, from …

Member Avatar for tux4life
0
380
Member Avatar for korssane

hi all, i am developping a c# asp.net web app and i have a few questions please. 1- i want to make visible a dropdown list when a certain radiobutto is checked. 2- i want to add this dropdownlist to the same Groupe name as the radio button ( could …

Member Avatar for Sri_r
0
181

The End.