Posts
 
Reputation
Joined
Last Seen
Ranked #129
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
93% Quality Score
Upvotes Received
211
Posts with Upvotes
151
Upvoting Members
73
Downvotes Received
10
Posts with Downvotes
9
Downvoting Members
9
47 Commented Posts
12 Endorsements
Ranked #151
Ranked #191
~176.18K People Reached
About Me

Mostly retired computer scientist after 26 years at Bell Labs and its offshoots. Founding member of C++ standards committee. Project editor for the 1998 and 2003 versions of the C++ standard. Author of "C Traps and Pitfalls" and coauthor of…

Interests
Most of my energy these days goes into music and photography.
PC Specs
Core 2 Extreme Q6850 (quad core), 3 GHz/3.25 GB RAM; Windows XP SP3.
Favorite Tags
Member Avatar for JoBe

Hello ladies and gents, Chapter 3 exercise 3-1: [quote]Suppose we wish to find the median of a collection of values. Assume that the we have read some values so far, and that we have no idea how many values remain to be read. Prove that we cannot afford to discard …

Member Avatar for Alfonso_4
0
845
Member Avatar for montjoile

hi there, I'm coding in windows, c++, but when I traslate my code to ubuntu, g++, I get this error: [B]lvalue required as left operand of assigment[/B] This is the line where I get the error: [COLOR="Red"][/COLOR][CODE]&*raiz=&*p;[/CODE] What could be the problem? *raiz and *p are pointers to an avl …

Member Avatar for Tushar_4
0
2K
Member Avatar for kylcrow

Hi. I am new to the forum and I had a question. I have looked around and haven't really been able to find exactly what I am looking for. I am looking for the code in C++ to read in a random single line with spaces from a file. This …

Member Avatar for zia shaikh
0
5K
Member Avatar for Dave Sinkula

With regard to C++ books, I'll just echo the advice here .The following books are recommended; read them in mostly the order listed." Accelerated C++ " Andrew Koenig & Barbara Moo " The C++ Standard Library " Nicolai Josuttis --- a "must have" " Effective C++ ", " More Effective …

Member Avatar for shahidali6
11
10K
Member Avatar for nightcrew

[QUOTE]Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need to be read in from standard input and printed out in sorted (ascending) order, each on a line by itself. Furthermore, there are no duplicates in the …

Member Avatar for omgerg
0
3K
Member Avatar for biljith

isnt this the shortest method [code=c]#include<iostream.h> #include<conio.h> void main() { clrscr(); int a,i=0; cout<<"enter a number"; cin>>a; while(a>0) { int b=a%10; a=a/10; i=i+b; } cout<<"sum="<<i; getch(); }[/code]

Member Avatar for ReaseySo
0
265
Member Avatar for bob89

I know that there are plenty of open source implemenations of AVL trees out there but I was wondering if it is possible to have a AVL that has repeat entries. I want to use one so I can search records by various fields. Eg I would have one for …

Member Avatar for paladin.lone
0
332
Member Avatar for crazyboy

Invalid sequence in stack permutation ???? inpurt sequence ... 1 2 3 4 5 1) 4 3 5 2 1 2) 2 3 5 4 1 3) 5 4 3 2 1 4) 3 4 1 5 2 Answer is .... 4) ..... but i dont know how ? can …

Member Avatar for bamasohn
0
545
Member Avatar for Kirielson

In C++ it seems like every single time you open a file, the inner contents get deleted quickly. Is there a way to open the file at the end of the last character while keeping all contents within the file? I've been looking at something with the End of file …

Member Avatar for ankit1990rana
0
8K
Member Avatar for blee93

I am doing Project Euler Problem 3, but I seem to get stuck. I have written some code that makes sense (at least to me) but keeps printing the answer to 137. This is the problem: The prime factors of 13195 are 5, 7, 13 and 29. What is the …

Member Avatar for vCillusion
0
356
Member Avatar for rena0514

Ackermann's function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Write a function A(m,n) that solves Ackermann's function. Use the following logic in your function: If m=0 then return n+1 If n=0 then return A(m-1,1) Otherwise, return A(m-1, A(m, n-1)) Test …

Member Avatar for guly2010
0
4K
Member Avatar for predator78

I'm hoping this will stir the pot a bit lol. But in all seriousness if you could get rid of the "need for greed" and "status", and yet not cross to many boundries. Don't you think that this could provide a more reasonable standard of living for everybody? My main …

Member Avatar for mike_2000_17
2
727
Member Avatar for Geli19

Hello Everyone. I am having trouble creating new objects in a loop. I am using: DataType *Ptr = new DataType (); I use this in the beggining of the loop then end the loop with: delete Ptr; Each constructor and destructor gets called each time the loop is executed.... but …

Member Avatar for Geli19
0
5K
Member Avatar for silvercats
Member Avatar for arkoenig
0
348
Member Avatar for henry.sj.shin

Hello All, I'm trying to write a function that outputs the reverse of the input. I know that you can use the built-in list.reverse() or S[::-1] methods, but I want to make it using the 'for' loop. My code initially is: def reverse(S) for x in S: print(x, end = …

Member Avatar for TrustyTony
0
390
Member Avatar for Microno

A while back i wanted to develop an application that calculated the integral of any polynomial that was input but I felt it was lacking the capability to to find more complex polynomials such as: > (x^2+x)/(x^2+x^3) Unfortunately my attempts at implementing a numerator and denominator as part of the …

Member Avatar for ravenous
0
167
Member Avatar for DonutsnCode

Hi guys, Your typical C++ beginner here. I'm using the renowned Deitel C++: How to program to learn C++. I am my own mentor and here's what I can't comprehend: What's a Dangling Reference? According to Deitel C++: How to Program and I quote "Functions can return references, but this …

Member Avatar for elmohler
0
922
Member Avatar for gerard4143

Is it possible to pass a map container to the copy algorithm and display it to the std::cout? If so how? What I tried below doesn't work but it looks like it should. Any comments or pointers will be appreciated. [code] #include <iostream> #include <string> #include <map> #include <algorithm> #include …

Member Avatar for gerard4143
0
349
Member Avatar for SoulMazer

Hi, I'm a beginner to C++ and am having some trouble with my list. I first define a struct named "bullet' like so: [code=c++]struct bullet { bool alive; bullet() alive = true; };[/code] Then, I create a list of objects of type "bullet": [icode]list<bullet> bullet_list;[/icode] In my program, I frequently …

Member Avatar for saravmittar
0
193
Member Avatar for misalazeem

Hello Everyone, I am writing chess code in C++ using a main cpp file and functions only.. SO basically am done with everything except the checkmate condition... the only conditions for checkmate i have checked are the movements that king can make.. but there might be other possibilities of saving …

Member Avatar for arkoenig
0
1K
Member Avatar for iamthesgt

This is another homework problem. I thought it was easier, and I wouldn't need help, but I keep getting a segmentation fault when running the program. The assignment is to use a recursive function to output the amount of candybars we can buy with a user-inputted amount of money. Each …

Member Avatar for markshah2
0
611
Member Avatar for optimumph

I'm trying to sort an array of numbers in ascending order and don't know whats wrong with my code (I'm completely new to vectors). I should first copy the input array (data) into an STL vector, then apply STL’s sorting algorithm to the vector, and finally copy the vector back …

Member Avatar for mzimmers
0
216
Member Avatar for eRayven38

Hey Guys, I am really trying to get into List-Implementation. Everything I wrote works fine except the "delete Element at Position" funktion. With the iterative Implementation there is no problem, everything works, but I want to do a recursive Version. This is the Task: Invent an algorithm which becomes a …

Member Avatar for deepu.sri24
0
1K
Member Avatar for sergent

I don't get why ISO don't include VLAs in C++ standard. C++ is supposed to be a C extension, and C99 clearly supports VLAs. It is not hard to implement and does not break any existing C++ code. It is useful for beginners, who do not yet know pointers, and …

Member Avatar for mike_2000_17
0
207
Member Avatar for programing

hi my program should implement queue using stack h make a code but i still have error if an one can tell me what is he error [CODE]#include<stdio.h> #include<conio.h> #include<process.h> int in_top=-1; int out_top=-1; void in_stack_push(int item); int in_stack_pop(); void out_stack_push(); int out_stack_pop(); int insert_queue[20],delete_queue[20]; void main() { int i,ch,item; …

Member Avatar for trin12345
0
173
Member Avatar for hujiba

I'm new at this so sorry if my vocabulary and stuff is totally off. With the following syntax, my goal is to call the choose_number function, which, when given two arguments (integers), returns one of those two at random. I run it multiple times with a for loop but it …

Member Avatar for doug65536
0
159
Member Avatar for Labdabeta

Quick question (though I still want to get my long OpenGL question fixed) is there a faster way to Xor the bits of an integer than this: [CODE](MyInt&0x1)^((MyInt&0x2)>>1)^((MyInt&0x4)>>2)//etcetera[/CODE] Just to clarify by faster I mean faster to execute, not to type as this operation will have to be done many …

Member Avatar for murnesty
0
93
Member Avatar for Pikachumanson

Ok I have an assignment for school where we are building a compiler step by step each week. This week I have to make a syntax analyzer that picks out the errors from this text file below. In the source code I have provided below I have a lexical analyzer …

Member Avatar for chocolaver
0
2K
Member Avatar for Kyren5058

Hi there, right now my teacher wants me to make an outline of a half-diamond with numbers, using for loops, kind of like the following: [code] 1 2 3 4 5 4 3 2 1[/code] The number 5 is a user input, so the half-diamond's width would be controlled by …

Member Avatar for cherrymae.calma
0
271
Member Avatar for frogboy77

English rioting for no apparent political reason, more a case of get what you can while the going is good. Does it get much worse than [URL="http://www.bbc.co.uk/news/magazine-14487982"]this[/URL]? Is society really broken?

Member Avatar for pseudorandom21
0
422