Posts
 
Reputation
Joined
Last Seen
Ranked #173
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
98% Quality Score
Upvotes Received
80
Posts with Upvotes
69
Upvoting Members
35
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
34 Commented Posts
~275.97K People Reached
Favorite Tags

420 Posted Topics

Member Avatar for ndeniche

Anyone who's ever seen Die Hard With a Vengeance should remember the answer to this one.. If you haven't seen the film, see if you can work it out in 30 seconds ;) [QUOTE]A man was going to St. Ives.. He met a man with seven wives.. Every wife had …

Member Avatar for Reverend Jim
1
482
Member Avatar for shift25

Your code is difficult to read - try adding some formatting! a few points to note 1) Why is there a semicolon before int main() ? Presumably its supposed to belong to the function prototype 2 lines up - you should put it there instead, else it just looks like …

Member Avatar for Helly_1
0
1K
Member Avatar for Dave Sinkula

One of the biggest problems with C++ books older than 1999/2000 is that they do not recognise alot of modern Standard C++ content. A problem commonly found with "revised" books after 1999/2000 (Books which were originally published long before C++ was standardised, but have been updated) is that the Standard …

Member Avatar for shahidali6
11
10K
Member Avatar for john_hasan

I wouldn't call 2 a special case - it fits the general description perfectly; [I]A number evenly divisible only by 1 and itself.[/I] :)

Member Avatar for aizam76
-1
3K
Member Avatar for PcPro12

That's a totally nonsensical question, what are you trying to do? Machine code is the very low-level instruction set that your computer's processor uses. Are you looking to learn how to program in an assembly language?

Member Avatar for T_CAD_MAN
0
434
Member Avatar for shorty001

In general, the steps to getting MSVC++ 2005 to work should be something along the lines of - Create a new Solution, using a Win32 Console Project - Right-Click on the project's name in the solution explorer, choose properties. - In the Configuration Properties Window, look for the option to …

Member Avatar for ps- india
-1
2K
Member Avatar for brahle

[QUOTE=Ancient Dragon]Using Microsoft compilers, I am not at all convinced that std::cout is faster than printf(). I have made similar tests in the past on other computers with M$ os and have never seen one where cout is faster than printf(). And I would be supprised if *nix computers was …

Member Avatar for neithan
0
2K
Member Avatar for addicted

You can't in standard C++ [url]http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.20[/url] [url]http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385[/url]

Member Avatar for Bob
0
2K
Member Avatar for dhruv_arora

Tell your school that you are unhappy about being taught using obsolete technology. Turbo C++ has no place in today's world, and insist that they provide you with an education which is relevent - i.e. by teaching you using modern material which works on modern compilers.

Member Avatar for harsh01ajmera
0
453
Member Avatar for OurNation
Member Avatar for chakrapani

Also, I would consider any code which attempted to automatically delete anything from my machine (whether it were browser history or otherwise) without my permission as malicious code. Your intentions may not be malicious, but you should seriously think about how users of your website are going to react. You'll …

Member Avatar for SehswagGxx123
0
12K
Member Avatar for kristen237

fgetc is a C function. The C++ way to do it is [CODE=cpp]char ch = std::cin.get() [/CODE]

Member Avatar for PrimePackster
0
209
Member Avatar for Snow_Fox

The [icode]>>[/icode] operator is whitespace delimited by default when used with any kind of stream; including cin, fstream and stringstream; so you can use that to your advantage to turn a stringstream into a simple tokeniser e.g. [code=cpp]#include <string> #include <sstream> #include <iostream> [/CODE] ... [CODE=cpp]std::istringstream hello("the cat sat on …

Member Avatar for Snow_Fox
0
250
Member Avatar for SCass2010

It's a little bit vague, but I think it depends exactly on what your code currently does and how much those objects have got in common (more importantly, how much your initialisation code has got in common) Are you currently implementing this using a lot of repeated code? If so, …

Member Avatar for Bench
0
198
Member Avatar for alenD

Short Answer: No. Long Answer... You only need to [b]delete[/b] something if - You created the object using [b]new[/b] (or you used some other library or function which created it with [b]new[/b]) - You own the object (i.e. it is not owned by a smart pointer or another class from …

Member Avatar for MastAvalons
0
588
Member Avatar for faraz ahmad

Here, you have declared a variable called [icode]ptr[/icode] [QUOTE=faraz ahmad;1762882][code] void question1() { int i=0; int* ptr=nullptr; [/code][/quote] Here you are declaring a completely different variable, which also happens to be called [icode]ptr[/icode] and hides the variable you'd previously declared by the same name.[QUOTE=faraz ahmad;1762882][CODE] while(boolean!=false) { cout << "Enter …

Member Avatar for MastAvalons
0
343
Member Avatar for personathome

[QUOTE=personathome;1762325] it either puts out c or some random number. Also I can not use isdigit unfort. [/quote] [CODE] char c = ch; if(c>=48&&c<=57) cout << 'c' << endl; [/CODE]A character inside single-quotes denotes a character value, so all you're doing here is printing out 'c'. This value has absolutely …

Member Avatar for Bench
0
235
Member Avatar for kikic

[QUOTE=kikic;1762284]I must not use finite function like that you write me,I need to write function step by step which works for alphabetic sorting in C++...[/QUOTE] Ancient Dragon's other suggestion was to do a google search for [i]Bubble Sort[/i] - try that and you will get plenty of good links which …

Member Avatar for Bench
0
260
Member Avatar for radiat

You're misunderstanding somewhat. It is not possible to simply resize a 'raw' array (Whether it is created by [b]new[/b] or as an ordinary array object). Once an array is created in memory, it can't be extended - The reason being that you have no control over the layout of objects …

Member Avatar for Bench
0
191
Member Avatar for hsayid

[QUOTE=gampalu]This program works... I don´t know if it's like this that youi want: //snip[/QUOTE] Most probably not! choose a language, either C or C++, and stick to it.. mixing the two like that is really a very very bad idea.

Member Avatar for studentba065
0
6K
Member Avatar for stupidenator

operator<<() is a member function - you can only pass one parameter at a time to your Stack object using operator<<() - eg, [CODE]Stack myStackObj; myStackObj << SomeValueHere;[/CODE] If you are merely trying to overload operator<<() then it should be a non-member function. When defined as a member, the object …

Member Avatar for journeyjie
0
10K
Member Avatar for tformed

That depends what the program is. I doubt that he's asking you to rewrite the sqrt, log and pow functions from math.h (Unless your course is a mathematics one). if you post a description of your problem, and the code from your current solution, there might be another way to …

Member Avatar for mikrosfoititis
0
1K
Member Avatar for literal

Are you asking for reviews? I don't own the book, but I am aware of its existance, and its outdated approach to teaching the language. C++ primer plus is an old book which was "updated" after C++ was revamped and standardised; unfortunately, when C++ was reborn as a new language, …

Member Avatar for snuffleupagus
0
281
Member Avatar for Bench

This code snippet outlines a simple, no-frills linked list. Tested under MSVC++ 2003 and Comeau, but not guaranteed bug free. Snippet includes example main() . This snippet is intended as an example of a possible implementation of a linked list class (Of which there are many variations) For a better …

Member Avatar for Narue
0
3K
Member Avatar for sergent

Mainly because of an observation by Edsger Dijkstra in 1968, where he argued "GOTO Statement Considered Harmful" (Google it and you'll find copies of the white paper) In brief, the observation is that (In general), the number of 'goto' statements a programmer uses in their code is inversely proportional to …

Member Avatar for arkoenig
0
547
Member Avatar for wildplace

if [inlinecode]Node[/inlinecode] is a template class, then the way to create an object is to specify the type you want inbetween < and > [CODE=cpp]Node<int> my_int_Node; Node<double> my_double_Node; Node<bool> my_bool_Node; //etc. [/CODE]

Member Avatar for wildplace
0
111
Member Avatar for lotsofsloths

First of all, I suggest taking a look at the short tutorial on random numbers here - [url]http://www.daniweb.com/tutorials/tutorial1769.html[/url]

Member Avatar for ichigo_cool
-1
1K
Member Avatar for livingsword

Bearing in mind that if this is a console application, there's a finite number of characters for any given line which you can output without the code spilling over to the next line, and completely ruining your formatting anyway. Therefore, it may be simplest to put in an upper limit …

Member Avatar for vipinkumar512
0
745
Member Avatar for krnekhelesh

These aren't examples of quines though - To qualify as a quine, the program must be able to replicate its own source code [U]without[/U] any input (either from a file, the keyboard, or anywhere else) see here for a little more info [url]http://en.wikipedia.org/wiki/Quine_%28computing%29[/url]

Member Avatar for mahaju
0
2K
Member Avatar for Sukhbir

I don't know how many others do this, but I've often found myself drafting replies to problems which people have posted, but not actually sending my reply straight away. On many occasions, i've kept the reply in a notepad document, and ended up deleting them, if I think i'm wrong. …

Member Avatar for abhityagi85
0
2K
Member Avatar for abarnett

[QUOTE=Narue;464574] It strikes me that your problem is confidence, and the best way to build confidence is to jump right in. Do something, anything, even if it turns out to be wrong. As it is you'll spend all of your time second guessing yourself and then you'll come to us …

Member Avatar for kvprajapati
0
2K
Member Avatar for sirko

In answer to the subject line - 'how does recursion work'. Recursion causes a new function call to be pushed onto your call stack. You may visualise it procedurally as a function which calls a function which calls a function etc. For example, an un-rolled "factorial" function would look like: …

Member Avatar for Bench
0
182
Member Avatar for terabyte

Everything which you learn from a book written in the past 10 years will be equally relevant long after C++0x becomes the accepted standard. Equally, however, there's nothing at all which stops you using a compiler which supports some C++0x features; its never a bad idea to learn using the …

Member Avatar for Bench
0
147
Member Avatar for krnekhelesh

[QUOTE=Salem;405240]Put the single character into a short string. Easy isn't it?[/QUOTE] ... [QUOTE=krnekhelesh;405530]yeah but the thing is everywhere I had used a char variable, so it would be difficult changing them all. Anyway I got an idea. I will copy the contents of the char to a string. And then …

Member Avatar for soltanmahmoud
0
445
Member Avatar for Supriyo

What exactly do you mean by [i]rules[/i]? There are no [i]rules[/i] for Coding style - such coding standards are usually based upon one or more of: [list] [*]Personal Preference [*]Conventional wisdom (i.e. what do 'most other people' do?) [*]Consistency with existing code (If you're modifying someone else's code) [*]Style imposed …

Member Avatar for xtrmR
0
356
Member Avatar for Ancient Dragon

I've heard a similar one to that before - [QUOTE]Success in mathematics is 90% perspiration and 20% inspiration[/QUOTE] One of my usenet and e-mail signatures for a very long time - [QUOTE]"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in …

Member Avatar for vegaseat
0
213
Member Avatar for Bench

For anyone who gets fed up with the somewhat verbose syntax involved in populating an STL map container with static arrays of std::pair (Or any of the other somewhat tedious ways of writing 'pair' combinations), here is a function which allows two different (statically allocated) arrays, of equal length, to …

Member Avatar for vijayan121
0
2K
Member Avatar for rohith_08

Is it that time of year when students have 6-month-long projects to start with 3 days remaining? :P

Member Avatar for pheininger
0
246
Member Avatar for Aia

Oh this is sombre news indeed. I would like to add my name to the end of the long list of people who really appreciated Dave's bold presence on Daniweb; in all the time I've spent lurking around these forums, his many contributions here never ceased to feel enlightening ro …

Member Avatar for sureronald
9
625
Member Avatar for jan1024188

Are you sure you've actually got an internal speaker? Not all motherboards have a connector for it. (Does your computer make a beep when you turn it on..?)

Member Avatar for +_+man
0
394
Member Avatar for Sarkahn
Member Avatar for Sarkahn
0
1K
Member Avatar for n00btechie
Member Avatar for Bench
-2
94
Member Avatar for monstercameron

I find the argument about simplicity to be somewhat perplexing - C++ and Java have amazingly simple syntax rules when compared to any natural language. I reckon you could summarise the fundamental syntax of most programming languages using a handful of sheets of paper; on the other hand, natural languages …

Member Avatar for 0x69
0
262
Member Avatar for SacredFootball

'eof' is a flag on a stream; it signals that a failed read attempt to read past the end of a stream has occurred, in other words, by the time your loop comes to find out that the stream has failed, a complete iteration of that loop has already tried …

Member Avatar for Lerner
0
210
Member Avatar for Dimitar

Why would you want to pre-allocate memory for a linked list? If you want to do that, you may aswell use a vector (or a deque).

Member Avatar for Dimitar
0
435
Member Avatar for deez2183

The fact that you have so many errors suggests to me that you need to start afresh, and create your program one bit at a time [i]slowly[/i]. Don't write 100 lines of code without trying to compile it, write a few lines at a time, or one small function at …

Member Avatar for jonsca
0
255
Member Avatar for madzam

Please provide more detail; Does your program compile successfully? If not, then please post the compiler errors/warnings; If so, what happens when you run your program, and how does this differ to what you're expecting?

Member Avatar for nbaztec
0
115
Member Avatar for darksmokepunch

things like 'game', 'player', 'room', etc don't sound particularly abstract to me :-) Usually when I think about [i]concepts[/i], the initial question is "what does the program [b]do[/b] - i.e. rather than considering the program as a bunch of uninteresting static objects, think about the interactions between them, especially in …

Member Avatar for darksmokepunch
0
127
Member Avatar for Valaraukar

what exactly is REGISTER_BUILDER? are you 100% sure that its a function? usually ALL_UPPERCASE names are reserved exclusively for #define macros it would help a great deal if you could show us the definition of REGISTER_BUILDER.

Member Avatar for Valaraukar
0
202
Member Avatar for memstick

the [icode]::[/icode] symbol is known as the [i]Scope Resolution[/i] operator because it is used to specify the scope in which an identifier resides within your program; The concept of 'scope' generally applies anywhere that curly brackets can be found [icode]{ }[/icode] - the reason for the concept of scope is …

Member Avatar for memstick
0
122

The End.