Posts
 
Reputation
Joined
Last Seen
Ranked #224
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
100% Quality Score
Upvotes Received
21
Posts with Upvotes
20
Upvoting Members
14
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
14 Commented Posts
0 Endorsements
Ranked #464
~105.96K People Reached
Favorite Tags
Member Avatar for Zach1188

The short answer is that you can't. The system() function (it's not a command) supported by win32 compilers/libraries starts up a command shell, and that command shell shows the "black command prompt window". If you actually need a command shell (eg you're running an inbuilt shell command or executing a …

Member Avatar for Giver
0
3K
Member Avatar for spiriad

TButton's constructor needs to be passed a pointer to a TComponent (eg a parent form) that is responsible for managing the button. It is also necessary to set various attributes: position, caption, visibility, the function to be called when the newly created button is created, etc etc. TButton is derived …

Member Avatar for Itamir
1
3K
Member Avatar for Alex Edwards

[QUOTE=Narue;715451][1] I can't say I've succeeded, but that's my goal.[/QUOTE] All good authors start with that goal. Very few fully achieve it, unless they simply finish off work started by someone else. The journey towards the goal, and products produced along the way, are actually what's important in the long …

Member Avatar for KelvinG
0
1K
Member Avatar for Duki

Firstly, your iterative versions aren't equivalent either: your iterate over a different interval in the loop. As to the differences with the recursive versions, there are all sorts of possible explanations. 1) The way you're measuring time may have different granularity. The clock time is not infinite resolution - hence …

Member Avatar for Loïc
0
931
Member Avatar for jared_masc

Not even close. Your code does not insert any characters into the string array. What is the purpose of the "input" argument supplied to the function? where is the codes counting the number of characters read (or inserted into a string)? Where is code to make it terminate at whitespace? …

Member Avatar for deceptikon
0
5K
Member Avatar for animefun2

[QUOTE=Aia;714931][QUOTE=Sci@phy;714926]The only reason this code should give you error is if you input something else that float, let's say letter [...] [/quote]scanf() would return an EOF in that case.[/QUOTE] No it will not. It will return zero in that case. EOF is only returned upon reaching end of input. If …

Member Avatar for abhishekjha
0
255
Member Avatar for Phaelax

[QUOTE=s0me1;690339]I'm not an expert, but I was reading this article: [url]http://www.icce.rug.nl/docs/cplusplus/cplusplus09.html#l153[/url] Apparently, if you overloaded the operator delete like this: void operator delete[](void *p, size_t size); the parameter "size" will tell you how long the array is. However, if you want the normal delete[], you'll have to write "::delete[]"[/QUOTE] Curiously, …

Member Avatar for Diego.Corso
0
27K
Member Avatar for n8thatsme

Instead of [code] while ( !indata.eof() ) { indata >> EmployeeInfo[employee_count].set_first_name(); cout << EmployeeInfo[employee_count].get_first_name(); // etc } [/code] try doing this; [code] string temp; while ( !indata.eof() && employee_count < MAX_EMPLOYEE_SIZE) { indata >> temp; EmployeeInfo[employee_count].set_first_name(temp); cout << EmployeeInfo[employee_count].get_first_name(); // etc } [/code] The additional check of employee_count stops running …

Member Avatar for mike_2000_17
1
4K
Member Avatar for cutedipti

[QUOTE=cutedipti;702575]Hi, But, when we define any character array as char a[3]={'a','b'}; then compiler here automatically consider '\0' null character to represent the end of the string [/quote] That's not true. You have explicitly initialised two elements of three-element array. The standards go about it in a round-about way (there's a …

Member Avatar for gerard4143
0
272
Member Avatar for prashanth s j

As a matter of fact, your code isn't valid C either. If you are going to ask for help in converting C code to C++, it helps if you post [u]working[/u] C code. You need to read [URL=http://www.daniweb.com/forums/thread78223.html]this thread[/URL] before posting again.

Member Avatar for hussnain abass
0
336
Member Avatar for aryansmit3754

Firstly, there is no space between the closing bracket at the end of FOR(x,n) and preceding the rest. That's a stylistic concern, but badly hurts readability. Second, and more significantly, typeof() is not a standard function or operator in C++. It is an extension specific to g++ (GNU c++) in …

Member Avatar for mrnutty
0
154
Member Avatar for mustafaneguib
Member Avatar for Nick Evan
0
263
Member Avatar for staufa

[QUOTE=devnar;715348][icode]string[i]=getchar();[/icode] I might be wrong though. Feel free to correct me. :)[/QUOTE] You're wrong. getchar() does not behave in quite the way you described. Consider yourself corrected. Salem is right. Once you get past the concern he pointed out, there are also additional problems that the code has no error …

Member Avatar for cthoes
0
315
Member Avatar for robertmacedonia

You're asking the wrong question. The compiler will attempt to invoke a copy constructor (assuming one exists) upon any attempt to create a copy of an object. The real practical concern is whether you need to write the copy constructor yourself or let the compiler do it for you. If …

Member Avatar for mrnutty
0
133
Member Avatar for VernonDozier

[QUOTE=williamhemsworth;759433]In one of my classes, there is one person named James Bond, and you can noticeably see how it affects his life (not in a good way). [/QUOTE] Naming a child James Bond is actually defendable: there were families named Bond for several generations who had a long-standing tradition of …

Member Avatar for sneekula
2
483
Member Avatar for Boudou

1) Get rid of the values array that is declared in biggest .... work with the array a that is passed instead (use a and count, rather than values and SIZE in the loop). Otherwise, biggest() will only ever find the largest value of that particular array. 2) You need …

Member Avatar for khusroo
0
133
Member Avatar for aiyer

break statements can be used in looping constructs, and in switch/case blocks. They cannot be used to break out of an "if" block, or as an alternative means of returning from a function. Also, <iostream.h> is non-standard. #include <iostream> instead.

Member Avatar for Comatose
0
734
Member Avatar for DeboJackson

You're using the function; presumably you can work out which header it came from. close() is not a standard function in C or C++. I'm guessing it is a function related to sockets handling under win32 or unix (typically in a header like <io.h>, but that varies). If my guess …

Member Avatar for grumpier
0
146
Member Avatar for a10m84

You're developing a realtime application, and don't know how to add values to elements of an array????? Pull my other leg: it'll play a tune for you. What is the criterion by which you would describe a method as "best"? If you are truly designing a realtime application, you will …

Member Avatar for Salem
0
141
Member Avatar for Bladtman242

[QUOTE=Bladtman242;776813]can i just change those values? either just by editing limits.h or by changing the value for a specific program? or can i make a variable of unlimmited size? [/QUOTE] Generally, you cannot. The contents of limits.h generally reflects technical limits on capability of your compiler on your target operating …

Member Avatar for Bladtman242
0
159
Member Avatar for Phil++

[QUOTE=Phil++;777683][CODE] switch (choice) { case 'p' || 'P': // do this break; case 's' || 'S': // do that } [/CODE] won't work[/QUOTE] Indeed. 'p' || 'P' would expand to a bool value of true, as will 's' || 'S'. Compilers will generally refuse to compile the above, as particular …

Member Avatar for grumpier
0
115
Member Avatar for dparas

If n is 1, then the set is {0, 1}. If you have a set for n, the set for n+1 can be generated by appending a 0 and then a 1 to all elements of the set n. For example, the set for n = 2 will be 0 …

Member Avatar for ArkM
0
1K
Member Avatar for titosd

A common way of return multiple values is by returning a struct which has multiple members, or for the function to accept a pointer that receives additional data from the function. You don't actually need to return multiple values though: return 0 if there is no operation, '*' if multiplication …

Member Avatar for death_oclock
0
166
Member Avatar for vikashkumar051

The whole point of Dijkstra's algorithm is to find a least cost (or shortest, in your case) path. Once you have a first path, eliminate one of the nodes (C2, C5, or C10 in your example) on that path from the graph, and run Dijkstra's algorithm again. If the resultant …

Member Avatar for vikashkumar051
0
759
Member Avatar for winrawr

[QUOTE=winrawr;776108]Should I avoid casting between data types? [/quote] As a general rule, yes you should. [QUOTE=winrawr;776108] I haven't really seen much about the use of this, but it seems like one of those last-minute-no-way-around kind of methods... but, for example, how would I use the length of a string in …

Member Avatar for grumpier
0
167
Member Avatar for Manutebecker

Try this. Comments added explaining the reason for change from your code. [code] #include <iostream> // <iostream> is standard, <iostream.h> is not #include <cstring> // need functions to work with C strings using namespace std; class Dummy{ char Name[256]; public: [color="RED"]// for main() to use a member function, it must …

Member Avatar for Manutebecker
0
8K
Member Avatar for CoolGamer48

My guess is that IMG_GetError() is throwing an exception. However, it's hard to say, as you haven't provided a complete example. You've paraphrased where your think the problem is. Try providing a small but complete example that illustrates your problem (with a main() function, and everything someone else would need …

Member Avatar for CoolGamer48
0
490
Member Avatar for prashanth s j

[QUOTE=prashanth s j;766955]Hi having void ** worked, I had to typecast the &outputbuffer to void **. [/QUOTE] Maybe so, but that doesn't make it a good idea. If your function assigns *outputbuffer to something to something that is not a char *, and then main() dereferences it, the result is …

Member Avatar for grumpier
0
141
Member Avatar for mrnutty

[QUOTE=firstPerson;771044]I might think the pythagorean therom would be better easier to use than trig.[/QUOTE] You're making a distinction that doesn't exist. The Pythagorean Theorem [u]is[/u] basic trigonometry.

Member Avatar for mrnutty
0
139
Member Avatar for Boormurgy

The cleaning lady? Seriously, it is necessary to assume the houses are ordered 1-5 (first to fifth) from left to right. Then a bit of persistence with eliminating anything that contradicts any statement, but it's not that hard. Basic application of Occam's razor: eliminate the impossible, and only the possible …

Member Avatar for grumpier
0
152