1,362 Posted Topics

Member Avatar for SocRcks13

Do you have some idea what area of computer science/programming you are interested in? In general, preparation for a career in programming calls for study in math, science, and good communication skills. As to learning programming, don't be overly concerned about a particular language - what you learn to do …

Member Avatar for Bond777
0
109
Member Avatar for rajatC

So once you've backspaced (or even as you backspace) output a blank space: cout << ' '; And then back the cursor up again

Member Avatar for rajatC
0
132
Member Avatar for Ezzaral

[QUOTE=vegaseat;508309]A boa constrictor or is it a python?[/QUOTE] You thinking of Shel Silverstein's [URL="http://www.poemhunter.com/poem/boa-constrictor/"]poem[/URL]? (Also done a a song by a few different artists.)

Member Avatar for Estella
0
214
Member Avatar for Srynx

dubeyprateek's second version is the best presented. You should not ever call main( ) from within you program, that essentially restarts a new instance of the program! Avoid using labels and goto's. Personally, I'd use a do...while loop structure, so that you don't have to force the loop condition true …

Member Avatar for CPLUSCPLUS
0
672
Member Avatar for obscured47

Why worry if the input is integer or floating point? Treat all as floating point and you have no problems.

Member Avatar for Duoas
0
135
Member Avatar for limac

[QUOTE=limac;501806]thanks invisal but, it didn't cause any compilation error but for any number i put in it is showing -1 as the result[/QUOTE] Which code is giving you -1? Your original code? As posted, your factorial code actually results in an infinite loop. Consider what it's doing: [code=c++] cin >> …

Member Avatar for rajatC
0
216
Member Avatar for Jishnu
Member Avatar for zoner7

Yes, you could write a program that copies the sample files to a new file, removing the leading digits, colon and space from each line. This would be a good exercise. You would not necessarily need to handle each line as a string, just read characters until the first space, …

Member Avatar for Jishnu
0
183
Member Avatar for zeroground

There are a lot of errors. You should try to find and fix them first. Read the error messages, look at the lines they point you to. One hint, you're trying to mix C style and C++ style output - choose one.

Member Avatar for toko
0
103
Member Avatar for evilwrench1975

[QUOTE=evilwrench1975;498587]miltary intelligence... quite possibly the dumbest people I know[/QUOTE] Be careful, we're watching you!

Member Avatar for Jishnu
0
163
Member Avatar for sneekula

I still have unrealistic expectations of getting back into the pants size I wore 5 years ago. When I'm in a real fantasy mood, I think about getting back into my AF uniforms. (I'm 11 years retired now.)

Member Avatar for twomers
0
272
Member Avatar for zeroground

Please use some code indenting to make it more readable. You join the tests for input not being 0 or input not being 1 with an OR (||), which means that if either the input is not 0 OR the input is not 1, it passes the test and is …

Member Avatar for Narue
0
68
Member Avatar for TheBeast32

A complete program would make it easier to evaluate your code. What you present does not seem to be a prime generator (something which will list out the primes in a given range) but rather, a tester for a given input number - is this prime or not. And at …

Member Avatar for TheBeast32
0
108
Member Avatar for Jishnu

Here's probably all the [URL="http://matija.monitor.hr/murphy/0001567/download/edition.htm"]Murphyisms [/URL]you could ever want or need

Member Avatar for vegaseat
1
506
Member Avatar for sneekula

[QUOTE=MidiMagic;493349] Totally virus-proof computer: Tandy Color Computer. The OS is in ROM, so it can't be compromised.[/QUOTE] The only totally secure computer is the one you put into a strong safe, with no power or data connections. Weld the safe shut, toss the safe into a deep, deep part of …

Member Avatar for MidiMagic
0
631
Member Avatar for scru

Here's some details, looks there were several events: [url]http://pasadena.wr.usgs.gov/shake/ous/[/url] Val

Member Avatar for GrimJack
0
101
Member Avatar for MidiMagic

[quote]49% of all statistics are wrong. -Anonymous.[/quote] 86% of people that quote statistics make them up.

Member Avatar for MidiMagic
0
171
Member Avatar for mrjoli021

[QUOTE=mrjoli021;496280]It gets included by default.[/QUOTE] really? With [code] #include <iostream> using namespace std; [/code] some of the string functionality is available. But not all. I can allocate and assign strings, and access string function. But curiously, iostream overloads are not available with including <string>. I suppose it's a matter of …

Member Avatar for Nosgammot
0
156
Member Avatar for vs49688

Put all the digits in an array, one digit per element. In a loop, display a character, then execute some delay mechanism for 1/4 second. Display next element.... A piece of code I believe I saw in another post here (sorry if I'm stealing someone's thunder) that will do the …

Member Avatar for Ancient Dragon
0
97
Member Avatar for nicz888

Well, there are many comments to be made. In your Binary Input file, you open the file for in/out and you truncate it. So, anything that was in it before is lost. Is that your intent? Your console input problem with multiword names is due to using the extraction operator …

Member Avatar for vmanes
0
81
Member Avatar for Jicky

A makefile contains various commands, controls, configurations, and file names used to compile and link a project. And much more. Google makefile and you will find lots of references and tutorials.

Member Avatar for jaepi
0
75
Member Avatar for people123

Value 223 (base 10) is 11011111 (base 2). Note that the only 0 bit is the 6th bit (counting from the right, the low end). So, when this value is bitwise ANDed with a number, every bit of the original value, except the 6th, will retain its original value. Remember …

Member Avatar for people123
0
139
Member Avatar for seyetotto

First, how does it compile without the <string> library included? Once that's fixed, it does output, to the file, as you designed the program to do. Your input, however, will not be correct, using the [inlinecode]infile >> inputNode.lastName >> inputNode.firstName >> ....[/inlinecode] method. This gets one "word" at a time …

Member Avatar for vmanes
0
113
Member Avatar for manster

The error messages are pretty clear: pim.cpp: In method `void PIM::search(class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> >)': pim.cpp:101: member `firstname' is a private member of class `Person' pim.cpp:101: member `lastname' is a private member of class `Person' These mean you cannot directly access the first/last name members, use the get____ methods you created. pim.cpp:105: …

Member Avatar for vmanes
0
187
Member Avatar for sneekula
Member Avatar for sneekula
0
105
Member Avatar for sneekula

We need to think outside the box, shift our paradigms, and boldly go where no (fill in the blank) has gone before.

Member Avatar for vmanes
0
140
Member Avatar for balla4eva33

Just for the record, the sort you're trying to implement is a Selection sort, not Bubble.

Member Avatar for balla4eva33
0
194
Member Avatar for komox

Well, in dog years it's 29;) The real question is, does it still function well, does it do what you need it to do? My main machine at home is a 5 year old Dell Dim 4500. I've added RAM, larger hard drive, and DVD writer to it, and it …

Member Avatar for bobbyraw
0
125
Member Avatar for The Dude

Nah, that one's just so much noise it goes in one ear and out the other. Now, you want something that will stick and annoy, how about this old disco hit: [url]http://www.youtube.com/watch?v=ZOtC-xvmFJI[/url] Val

Member Avatar for Jicky
0
93
Member Avatar for vmanes

From the standpoint of writing the sorts of programs first and second semester C++ courses use (fairly simple command line programs), has anyone found any significant differences in the VS IDE or how C++ programs compile, compared to the 2005 version? thanks, VAl

Member Avatar for Ancient Dragon
0
119
Member Avatar for Ensabahnur

In that case, you must pass both arrays to the sort function. When you exchange members of the array upon which you are sorting, also exchange the same members of the other array.

Member Avatar for Ensabahnur
0
219
Member Avatar for harpreet1582
Member Avatar for 187

This same problem appeared in an earlier post (within the last day) [code] while ((pal = cin.get() != '\n') && (index < (MAX - 1))) [/code] is not doing quite what you want it to. Look for the previous explanation. When quoting error messages, it helps to give the line …

Member Avatar for 187
0
364
Member Avatar for Max_Payne

Do you mean that you want [b]i[/b] to be one larger every time you call the function to output a line? How about making it a static variable, as in: [code] ostream &operator << ( ostream &output, const Course &xCourse ) { static int i = 0; output << " …

Member Avatar for Ancient Dragon
0
92
Member Avatar for mb523

In your reading loop, the input statement needs to be enclosed in parens before comparison to newline character, as so: [code] while ( ( (ch = cin.get()) != '\n') && (index < MAX-1) ) [/code] Othewise, ch was not being assigned the character read in, but rather, the result of …

Member Avatar for vmanes
0
2K
Member Avatar for Jishnu

end( ) returns an iterator pointing to the last object. back( ) returns the last object( the value )

Member Avatar for Jishnu
0
120
Member Avatar for superjacent

The object pstr is an address. When you return pstr from the function, the value of that address is returned, so that in the calling function, you assign that address to ps. If you can step through the code in a debugger, notice the value (address) pstr has, and the …

Member Avatar for superjacent
0
135
Member Avatar for talk2tisa

If you mean why are the low and high temps shown twice - it's because in those function you have the loop running two iterations. In fact, what you show are the highest high and the highest low, and the lowest high and the lowest low. Also, in both the …

Member Avatar for WaltP
0
102
Member Avatar for Nidaa87
Re: help

to do any realistic comparisons of sorts functions, you'll need to use a larger data array. Even then, on a modern PC, the time to sort will be so quick, you may have to run the sorts many times in succession to see a difference. Access the system time before …

Member Avatar for Nidaa87
0
93
Member Avatar for bpage

The j loop need only go as far as the current value of k - no need to test past the point of where you've successfully stored data. The j loop doesn't work well as a for loop - you will continue testing and assigning even once you've found that …

Member Avatar for bpage
0
158
Member Avatar for jacknight

You have to do the whole algebra thing. [code] (S + L)/2 = S/2 + L/2 S + (L - S)/2 = S + (L/2 - S/2) = S + L/2 - S/2 = S - S/2 + L/2 = (2S/2 - S/2) + L/2 = S/2 + L/2 [/code] …

Member Avatar for Narue
0
147
Member Avatar for Biro

Generally, if you are running your program from within the Visual C++ (Visual Studio) environment (using the Debug menu), your input/output files will be in the project folder - the same place you find your .cpp file. If you try to run the executable directly (in a command window or …

Member Avatar for Salem
0
907
Member Avatar for henpecked1

How does [code] void getCardValue(cardValues & userCardValue) { int value; cout << " What is the value of your card? => "; cin >> value; if( value >= two && value <= ace ) userCardValue = cardValues( value ); return; } [/code] work for you? Val

Member Avatar for henpecked1
0
128
Member Avatar for fith

That's not a whole file, so how is one to replicate your problem, or even undertand what we're looking at? Without the variables and function parameters, it's just some code. Which line does the error message point to?

Member Avatar for WaltP
0
358
Member Avatar for warpstar

The code you posted looks like it should just print the number stored at the last node visited in each smaller and smaller walk through the list. If you are seeing 1 2 3 4 1 2 3 1 2 1, then you probably have moved the output statement inside …

Member Avatar for vmanes
0
93
Member Avatar for Ancient Dragon

I think it's going to take a week to get that tune out of my head!!!!!

Member Avatar for scru
0
72
Member Avatar for hectic

No, line 18 is not your problem. Perhaps you need to better identify where the program crashes - put some output statements that tell you when you start each section, step through it in a debugger, .... Posting the whole code so someone could attempt to recreate the problem would …

Member Avatar for Ancient Dragon
0
257
Member Avatar for chubbs1900

Have you made an attempt to modify the program to do so? Please post that. Val

Member Avatar for WaltP
0
108
Member Avatar for chubbs1900

Have the inner loop start at 1, go up to or equal lineCtrl, incrementing along the way. Val

Member Avatar for vmanes
0
81
Member Avatar for Tell Me

Not that I know of. You have to read some (all) of the file, then search using any of several possible methods. If you expand on your problem definition, and show the work you've done to solve it, you will get better help here. Please read the forum rules. Val

Member Avatar for Tell Me
0
263

The End.