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
~273.37K People Reached
Favorite Tags
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
432
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
449
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
11K
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
207
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
247
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
195
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
584
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
342
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
233
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
257
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
190
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
279
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
541
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
109
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
730
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