51,593 Topics

Member Avatar for
Member Avatar for hao001

Hi..i saw this a randomly..i got some part don't understand: [url]http://www.daniweb.com/forums/thread214624.html[/url] @ancient dragon's reply 1) const unsigned int MAX_SIZE = 2; student array[MAX_SIZE]; Q: Why MAX_SIZE = 2 ? 2)15: void insert(student array[],const unsigned int MAX_STUDENT); 33: void mySort(student array[],const unsigned int MAX) 55: void display(const student array[], unsigned int …

Member Avatar for hao001
0
132
Member Avatar for icu222much

I am new to programming in C++. I have a bit of experience in Python and ActionScript3. I decided to pick up C++ so I downloaded Dev-C++ complier. I tried to run the following code but it doesn't seem to do anything. I complied the code, and it did not …

Member Avatar for hao001
0
207
Member Avatar for krellor

I haven't wrote in C++ for a long time so I decided to brush up a bit by writing some basic programs. I wrote a class that allows for basic arithmetic of infinitely large numbers (or as much as you have memory for). Here is the code. [CODE] class largeInt …

Member Avatar for krellor
0
147
Member Avatar for gerbanzo129

Hey i have a simple output program that i can't seem to figure out Home Owner Price of Home Seller's Cost Agent's Commission Garcia *****100000.00**********6000.00**********1500.00

Member Avatar for gerbanzo129
0
81
Member Avatar for Der_sed

[CODE]#include <iostream> #include <cstdlib> using namespace std; const int arrSize = 100; bool isPresent(int ,int ); int main() { int myArr[arrSize]; int input; for (int i=0; i<=arrSize; i++) myArr[i]=rand()%200; //creating array with random numbers //sorting random numbers for (int j=0; j<=arrSize; j++){ for(int k=0; k<j ; k++){ if (myArr[j] < …

Member Avatar for VernonDozier
0
94
Member Avatar for ExMachina

Hello all, So to start off I'm just starting to learn programming so please excuse a lot of my noob mistakes especially when trying to explain what is going on/wrong. I've been trying to use a header file in an example program I'm trying to complete but the compiler doesn't …

Member Avatar for Frederick2
0
170
Member Avatar for omri374

Hi, I'm programming an application that records video samples of 5 seconds each. the recording takes place inside a loop. I use MFC and DirectShow The thing is, that the main thread must pause for 5 seconds while the sample is being recorded. in order to do that, I can …

Member Avatar for omri374
0
383
Member Avatar for Oritm

Hello all, I'm used to java programming and php. I'm trying to learn C++, but it's rather difficult for me. Basic in java: String message = "Test"; String temp = "This is a " + message; temp now contains "This is a Test". In c++ i tried everything, a + …

Member Avatar for Lerner
0
140
Member Avatar for dpreznik

I am facing a problem with a CArray. I have a class member of type CArray<MyType, MyType&> m_MyArray; When the object is destroyed, of course the destructor of CArray<MyType, MyType&> is called. Here is the destructor: [CODE]template<class TYPE, class ARG_TYPE> CArray<TYPE, ARG_TYPE>::~CArray() { ASSERT_VALID(this); if (m_pData != NULL) { for( …

Member Avatar for Tom Gunn
0
213
Member Avatar for wewehalim

Hi, i need help in building a program about automata cellular. So, there is 4 state of cells, `0 = space, 1 = ".", 2 = "+", 3 = "#"` This state is continuous from 0 - 3, after 3, it will be back to 0. we need to compare …

Member Avatar for wewehalim
0
533
Member Avatar for Demonisya

Hello guys i need help on my program factoring.... i have the progam here but the bad news is it is been giving me -3242 or infinite number as an output... I already been so busy changing any thing but i cant make the output correct the way it should …

Member Avatar for minigweek
0
2K
Member Avatar for xfreebornx

[CODE]#include <iostream> #include<vector> #include<ctime> #include<algorithm> using namespace std; struct student { int id; char name; char nationality; char gender; student() : id(0) , gender(' ') { } student(int i, char g) :id(i), name(g) { } }; void insert(student array[]); bool sortByID(const student& a, const student& b) { return ( a.id …

Member Avatar for hao001
0
320
Member Avatar for kreskin

Hi guys, I am new with c++, so please bear with me... I am reading in a text file that similar to this: $ABCDE,12345,12345,12345,12345.... I need to be able to place each number in a variable like: A = $ABCDE B = 12345 C = 12345 ... I can get …

Member Avatar for kreskin
0
142
Member Avatar for wyett

Alright. Basically the point of this program is to allow a user to select how many fractions they want printed on the screen. It is supposed to print 3 fractions PER line. If a user requests 4 fractions..it would print 3 and print the 4th fraction by itself on the …

Member Avatar for wyett
0
115
Member Avatar for shuffman

I'm working on this problem that has n positive integers in a row except for the first column, which always contains zero, these numbers represent the cost to enter each column. I'm supposed to get to the end of the board with the path that costs the least. I can …

Member Avatar for shuffman
0
82
Member Avatar for onaclov2000

So I guess my question is: Can I grab an entire line using cin.getline(), and grab an entire line and ignore the whitespaces? What I'm trying to do is grab the following line: 2 3 and I want to know how many numbers are in it? OR maybe a better …

Member Avatar for necrolin
0
122
Member Avatar for Lukezzz

In a textChanged event for a textBox I am trying to do a search function for ListBoxItems like below. It seems that I have done the code correct but no items is selected and when writing a string that is longer in length than the item that is shortest in …

Member Avatar for Lukezzz
0
84
Member Avatar for ellimist14

Sorry about a n00b question but I'm having trouble. I'm messing around with linked list to try to get a good handle on them for the program I have to write. The program below was intended to fill a link list with structures then print out each structure. Instead it …

Member Avatar for ellimist14
0
116
Member Avatar for jwill113

[code] #include <string> #include <iostream> #include <fstream> #include <list> using namespace std; #include "mono.h" int main() { int e; string m; string z; string fname; mono * mptr; mono * mptr2; list<mono>P1; list<mono>P2; list<mono>::iterator P1itr; list<mono>::iterator P2itr; cout<<"Menu"<<endl<<endl; cout<<"A Enter two polynomials from a file"<<endl; cout<<"B Enter two polynomials via …

Member Avatar for jwill113
0
104
Member Avatar for helpme123456789

This is what I have so far. This isn't working and this isn't even close to working. I'm not that experienced at C++ so I was hoping that someone would help me please. The assignment is basically to write a code to validate an email address to see what characters …

Member Avatar for VernonDozier
0
228
Member Avatar for Avatar99

It compiles and executes but for some reason my vectors do not initialize in the fillarrays function. What am I doing wrong? [code]#include <iostream> #include <conio.h> // for getch() #include <vector> using namespace std; bool and (std::vector<bool> p, std::vector<bool> q, int i); // returns bool for and bool or (std::vector<bool> …

Member Avatar for Avatar99
0
137
Member Avatar for ThomsonGB

I have attached a .JPG file to this post. I am just starting out with the microsoft visual c++ and I wonder if someone could show me an example like this that would simply show the progress bar mve when the Trackbar is moved. I just need to see the …

Member Avatar for Protuberance
0
98
Member Avatar for scrypt3r

I have a program that injects a MessageBox Dll into a running process, although the user has to input the process to injects PID, is there a way to get the process PID from its image?

Member Avatar for William Hemsworth
0
167
Member Avatar for bal_1991

okay..so here's the thing......i have a test comin up tmrw regarding stacks and queues using templates....but my knowledge abt templates is minimal...could you plz suggest some links so as to understand templates from the scratch??? thnkx bal_1991

Member Avatar for bal_1991
0
92
Member Avatar for Tom Tolleson

Hey, guys. I've decided to learn C++ for fun while we're having some downtime here at work. I'm using Microsoft Visual C++ and it doesn't explain a couple of bits of basic syntax: On the line int main () What does "int" stand for? It seems to be used for …

Member Avatar for Tom Tolleson
0
129
Member Avatar for pratzmnnit

I want to write a function, bool brokenDownTime(const time_t& time, const string& timezone, struct tm& brokenTIme); here brokenDownTIme() should convert the 'time'(since EPOCH) to broken down time 'brokenTime' after adjusting for the timezone specified by 'timezone' Thanks, Prateek |[code]I want to write a function, bool brokenDownTime(const time_t& time, const string& …

Member Avatar for Salem
0
88
Member Avatar for Ultratermi

Hey. Im working on a new Project but i need your help converting a std::string to double! I dont know why i get the LNK error so i hope someone of you know it :). Here are the includes... [code=C++] #include "stdafx.h" #include <windows.h> #include <iostream> #include <stdlib.h> #include <stdio.h> …

Member Avatar for Ultratermi
0
137
Member Avatar for volscolts16

I am getting this error when I compile. I have tried taking Add out the code, but I do not get an output then. How can I fix this to produce an output?? [CODE] //This program serves as a test for the Matrix class #include <iostream> #include "Matrix.h" using namespace …

Member Avatar for Salem
0
184
Member Avatar for xfreebornx
Member Avatar for VernonDozier
0
105
Member Avatar for power_computer

I am in a comp. sci course in uni. We use CentOS and the CC terminal line compiler. On my laptop I work in windows and use Dev C++, I've created a custom header file which contains a class and I want this header file to be used in a …

Member Avatar for Protuberance
0
140
Member Avatar for tomtetlaw

I need to be able to use the /P compiler option, how do I set them in VC++ 2008?

Member Avatar for kvprajapati
0
23
Member Avatar for Bezelis

Hi to all, I would like to optimize my programs compiled with Visual Studio 2008. I know there're flags to enable the instruction sets of CPUs (MMX, SSE, SSE2, ...). Can you please tell me how and where I have to insert these flags? Thanks in advance.

0
62
Member Avatar for atch

Hi, guys. Just installed new borland c++ 2010 - I think it's quite cool. One question though, where can I find comment and uncomment command? Thank you

Member Avatar for atch
0
159
Member Avatar for crh0872

Hello DaniWeb, So I have a function: [CODE] time_t current_time = time( NULL ); while ( 1 ) if ( time( NULL ) == current_time + 3600 ) // execute body every hour { // stuff current_time = time( NULL ); } [/CODE] This is the only way I could …

Member Avatar for omri374
0
84
Member Avatar for jegathis

Hi thr, I'm Jega, doing a project on data preprocessing using discretization(data mining methods). There is an algorithm called EFB(Equal Frequency Binning) using C++ as coding. Do any1 here familiar with machine learning. I got the algorithm, but coding part, i just too weak in tht.

Member Avatar for jegathis
0
141
Member Avatar for F2guy

Can you see why the code from simulation.cpp marked with: // clipped output start and // clipped output end produces the clipped output below.(The "..." is where I deleted repeating output to make it more readable) Letter key can be found below after output. Initializing neural network... SOMa memory usage: …

Member Avatar for Salem
0
140
Member Avatar for Hawkpath

Hello, I'm currently in High School and looking for a career in programming, and my dilemma is this: Game programming or Software Engineering? I have heard the horror stories of terrible hours and bad job security in game programming. But I haven't heard much about software engineering. Please enlighten me. …

Member Avatar for geoffy0404
0
456
Member Avatar for yakovm

[CODE]#include<iostream> using namespace std; struct Base{ virtual void print(){cout << "Base"<< endl;} }; struct Derrived : Base{ void print(){cout << "Derrived"<< endl;} }; template< Base* arr,int size = 10> class Template{ public: void print(){arr->print();} };[/CODE] [CODE]#include "template.h" int main(){ Base *b = new Base(); Derrived *d = new Derrived(); Template<b> …

Member Avatar for mrnutty
0
118
Member Avatar for BlackPhoenix

I'm working on a project. It involves networked code, so I wanted to send it to a friend to test it with. I sent him only the .exe in my Debug folder, and it had an error on opening. It said something similar to "can not open because side-by-side config …

Member Avatar for BlackPhoenix
0
104
Member Avatar for Talguy

is there a short hand way of passing just a row in a 2d array into a function that accepts only 1d arrays. for example something like this even though I know that this doesn't work. I don't want to have to use loops to copy a row from the …

Member Avatar for Talguy
0
99
Member Avatar for renzo2k3
Member Avatar for meanace

Hi. Im making a program which uses an array from the main function and passes it to a function which displays a table. However i am having a problem with calling the function in the main. When i compile my program it shows error LNK2001 (unresolved external symbol). Thanks for …

Member Avatar for meanace
0
102
Member Avatar for khanalone1

Dear All, I have been stuck and confused while bringing changes in this program which i got from [url]http://www.dreamincode.net/code/snippet76.htm[/url] This program uses a simple 0xFACA character and adds and subtracts for doing encryption and decryption. Now what i want to use is asymmetric encryption technique or we can say part …

Member Avatar for khanalone1
0
529
Member Avatar for yakovm

Hello Can define template<int n> class myClass{...........} can I define template <Base *b> class myTemp{ ............. } while class Base is defined properly. Thank you.

Member Avatar for mrnutty
0
69
Member Avatar for bil050

Hi, How can I define template formal parameter as T*? I read in some textbook that if I define template with formal parameter T* then actual parameter can be of the type T1*,provided that T1 is derived from T Thank you in advance

Member Avatar for mrnutty
0
100
Member Avatar for dgr231

Hey guys, I am still pretty new to C++ and am completely self-taught up to this point. I am currently learning about try, throw, and catch statements for exceptions and am trying to incorporate this into my programs. I know that normally when you allocate new dynamic memory, if the …

Member Avatar for gotorightway123
0
1K
Member Avatar for picass0

i have problem trying to extracting the string from the text file. i knows how to read from the file but unable to extract the string which i want. i wanted to extract only the id out, how can i do it? my text file format is below: [CODE]user:password,id,office[/CODE]

Member Avatar for anupa
0
1K
Member Avatar for yonghc

After a brief and rocky relation, I have had jilted Borland 5.02 and found new love for CODE::BLOCK only to discover a while ago that Borland could compile a code snippet which CODE::BLOCK couldn't. In the working program produced below, CODE::BLOCK gave out an error message and failed to compile …

Member Avatar for yonghc
0
433
Member Avatar for Alexar93

Hi! I've started to write my kernel in assembly but I think its far too complicated! Instead I would like to try to write it in C/C++. I'm new to these languages but i've written alot in VB and C# so I don't think it's going to be too hard …

Member Avatar for Salem
0
206
Member Avatar for redserpent7

[B][COLOR="Red"]Important:[/COLOR] [COLOR="Green"]Please read the whole question before answering.[/COLOR][/B] I would appreciate it if someone can guide me to the new MS APIs necessary for modifying/controlling the Windows 7 Action Center. What I need to do is integrate the Backup notification messages in my application which is a backup application in …

0
146

The End.