1,362 Posted Topics

Member Avatar for timb89

[icode]if (s1.at(i) == s2.substr(s2.length()-i-1,1) )[/icode] is attempting to compare a character to a string. Even though you limit that substring to one character, it's still a string.

Member Avatar for ArkM
0
108
Member Avatar for gnobber

Printer - yes. Mouse/trackball, not so much. A stream is the source or destination of a series of data, either characters, or in the case of binary files, a sequence of bytes that represent memory content. Since it's an abstraction, you can operate on any stream in the same manner …

Member Avatar for sai sushma
0
154
Member Avatar for NathanOliver

How big a block are you reading from the source file? It might be the file I/O is your bottleneck if you read in many small chunks.

Member Avatar for NathanOliver
0
152
Member Avatar for SantaPotato

[QUOTE=SantaPotato;882940] (PS- I heard Vista users get a free Windows 7 upgrade. Do I need a CD for that?) Thanks for reading. :)[/QUOTE] You probably heard from someone who doesn't know what they're talking about. With the recent announcement of a 22 Oct release of Win7, there will be a …

Member Avatar for makavelli
0
94
Member Avatar for ithelp

[QUOTE=vegaseat;881229]The only perfectly empty space I know of, is in the cranium of certain politicians. Yes, in that space many scientific laws malfunction.[/QUOTE] I was going to say something along that line of thought - I like yours. 'Nuff said!

Member Avatar for vegaseat
0
143
Member Avatar for ithelp

left control, right shift, and space bar seem to be the most beaten up on the one keyboard I have that's seen enough use to show wear (it's only about 7 or 8 years old.)

Member Avatar for vegaseat
0
164
Member Avatar for iammfa

With your project open, use menu Project | Properties, Configuration Properties, General. There you should see the path for the Release execuatable ( .\Release). If it's not that, set it to be so.

Member Avatar for iammfa
0
99
Member Avatar for yun

Instead of the big if...else if block, how about [code] for( int i = 0; i < 10; i++ ) { index = arr[i] / 10; str[index] += "*"; } [/code]

Member Avatar for vmanes
0
2K
Member Avatar for degarb

The Read Only attribute has no meaning or effect on folders, ignore it. Your problem is permission - are you running an account that has administrator privelege? You might try taking ownership of the temp folder (are you sure you're looking at the right folder, usually it's C:\Windows\Temp or C:\Documents …

Member Avatar for Jupiter 2
0
197
Member Avatar for pspwxp fan

Or, have the outer loop go by steps of 2, and use its current value as the limit for the inner loop that prints the *s.

Member Avatar for pspwxp fan
0
577
Member Avatar for laila christin

It should be found in C:\Program Files\HP\Shared or some similar folder. It's believed to be the used by the program for the LightScribe functionality for your DVD drive, but this is not confirmed by any info from HP. I don't find any direct way to halt it or stop it …

Member Avatar for vmanes
0
101
Member Avatar for matt9b
Member Avatar for vmanes
0
44
Member Avatar for don0369

Um, this is a C++ forum. You'll get more and better response in the C forum. And, csurfer, using eof( ) in that manner is going to unreliable at the end of the file, last value read in could be processed twice. This has been amply discussed on the forum.

Member Avatar for don0369
0
120
Member Avatar for adarshcu

I would expect temp to still be be an empty string. Note that an empty string is one which has no content. It is not the same as NULL.

Member Avatar for vmanes
0
101
Member Avatar for lexusdominus

Your question is bit open ended and not fully clear, but how about a file that contains the names of all the various data files. You open and read that, storing each file name into an array element. You can then open whichever data file(s) you need. Perhaps even have …

Member Avatar for csurfer
0
277
Member Avatar for pinkdiva

Windows 7 is the next version of Windows, succeeding Vista. But hey, you could have found that very easily with just a quick googling. Would have gotten you an answer about 21 minutes ago.

Member Avatar for pinkdiva
0
108
Member Avatar for san gabriel

Your use of strcmp( ) is correct. However, your strings aren't strings. You must allocate memory for s1 and s2 as arrays of char. Or declare them as char pointers and then allocate with the new operator. Your subject says "strncmp( )". If you want to use that variant, which …

Member Avatar for mirfan00
0
446
Member Avatar for s_sridhar

Your code does in fact have a main( ) function? And you did add the code file to the project? Look in the Solution Explorer - is your code file shown under the Source Files subfolder?

Member Avatar for s_sridhar
0
115
Member Avatar for djm123

If you mean to change what page is used as a home page, that depends on which browser you're using. Firefox - Tools | Options | Main tab IE - Tools | Internet Options | General tab

Member Avatar for vmanes
0
35
Member Avatar for sharkattack85
Member Avatar for vmanes

Tried to read some newsgroups I follow, got "server not found" replies. They've had problems in the past, so I called tech support. Was told they dropped usenet, today. No notice, no warning, nothing. Just gone! I've got half a dozen or so newsgroups I follow, some related to hobbies, …

Member Avatar for jephthah
0
120
Member Avatar for jdm

Putting the break (or exit( )) inside the if block is not a wholly satisfactory method. The conditions in loop ought to indicate when/why the loop ends - don't hide surprises inside the body. How about a structure like: [code] inData >> num; if( num < 5 ) { do …

Member Avatar for jdm
0
226
Member Avatar for GSPprog

A common, simple model for entering data till there is no more is something like: [code] struct empl {string name; int ID, department; }; empl workers[10] int limit = 10; int count = 0; while( count < limit && getline( cin, workers[count].name ) { cin >> workers[count].ID; cin >> workers[count].dept; …

Member Avatar for GSPprog
0
422
Member Avatar for brightsolar

Case 4 - where to start!? You cannot just declare a char* and then use it for input - you must allocate memory to the pointer. Why not just allocate it as a char array, like [icode] char strSearchData[128];[/icode] (Choose a size you think is sufficient for any fool who …

Member Avatar for brightsolar
0
238
Member Avatar for Aia

Laughter - the best medicine. And the only one we'll be able to afford?

Member Avatar for GrimJack
0
167
Member Avatar for zack.walters

Looking at the grade evaluation problem [code] int dataGrade() //function that shows table and grade { if (average <= 100 && average >=90) //am I doing this right? grade = 'A'; //I feel like something is missing? else if (average < 90 && average >= 80) grade = 'B'; else …

Member Avatar for ithelp
0
215
Member Avatar for szcfama

Firstly, please don't write in ALL CAPS. It's considered shouting, and is a bit rude. Secondly, please don't keep starting new threads on the same code problem. I see at least three other threads, under two user names. Thirdly, does your student data file in fact have exactly as many …

Member Avatar for amrith92
0
126
Member Avatar for jephthah

I enjoyed the movie. Yes, it changes some of the ST canon that many feel shouldn't be violated, but, hey, that's what time travel is all about. If you're in a bookstore, look for the novel based upon this movie (or is the movie based on the novel, or are …

Member Avatar for vmanes
0
207
Member Avatar for atman

You cannot get input to pointer s without first allocating it some memory. What you're doing is attempting to store to whatever memory address s points to, which could be pretty random! If you've not allocated the memory, you don't control it. If you don't control it, you should not …

Member Avatar for vmanes
0
106
Member Avatar for K'rul

Your readfromfile( ) does nothing but read through the file, it does not store anything to your array of students. In the addStudent, what's wrong with the following bit? [code] cin>>tempValue; temp_array[num_of_students].Mark1 = atof(tempValue.c_str()); [/code] Where are you attempting to store data?

Member Avatar for K'rul
0
101
Member Avatar for still_learning

Imagine you have it all drawn out on paper - the locations of customers and the potential store sites. How would you solve it manually? Approach it from a strictly procedural method - don't assume anything that you as a human might see from the particular data set. Rather, how …

Member Avatar for siddhant3s
0
156
Member Avatar for cigur
Member Avatar for tux4life
0
118
Member Avatar for pt_solar

It looks like you're close to having a working program. Have you tried compiling? If so, you'd find that you have two errors. One is a missing #include and the other is a small typo. Find and fix those. Then you'll find a problem if you try to enter a …

Member Avatar for pt_solar
0
275
Member Avatar for lukeriverplate

Your code is C. This is a C++ forum. It looks like it should do what you ask. Does it run? Does it give the results you want? What's your question? And, when you post code, please put it between code tags, thusly [noparse][code] your code goes here [/code][/noparse]

Member Avatar for s_sridhar
0
152
Member Avatar for JLopeman

And get rid of the excess "out<<" in your ostream method. It'll run as is, but give odd results.

Member Avatar for JLopeman
0
241
Member Avatar for teddycow

One problem, you're mixing data types. [code] char ....... , i; { ifstream array2; array2.open ("array.txt"); array2 >> i; for(a=1;a<=i;a++){ [/code] You read in to the character i, getting the character '3'. When you use i as the for loop limit, it gets typecast to an integer value, its ASCII …

Member Avatar for tux4life
0
104
Member Avatar for GrimJack

Just remember. Without electricity, much of which comes from coal, we wouldn't be carrying on this conversation.

Member Avatar for GrimJack
0
88
Member Avatar for MicrosoftMahmou

Your first line creates an array of int pointers. The p[i] line allocates memory to each of those pointers, in effect created an 2-dimensional array of ints. So, each p[i] is the name of a single 1D array of int.

Member Avatar for MicrosoftMahmou
0
81
Member Avatar for Adexter

Lets start with an easy one [code] void StuRead(&ifstream studentType students[]); [/code] The & goes after the data type (ifstream &) and you need to put a comma between the two arguments. If you're going to put the parameter name on one, why not both? So, a corrected version of …

Member Avatar for NathanOliver
0
125
Member Avatar for smyth9957214249
Member Avatar for deepugtm

Spybot also has such a feature. They don't identify every registry change - you'd never get any work done if that happened. They generally indicate when some program being installed/updated wants to change the registry.

Member Avatar for Godsp3ed
0
129
Member Avatar for eyjey

Is that CD actually an XP install disk with SP3 included, or just the SP3 update?

Member Avatar for Godsp3ed
0
113
Member Avatar for VernonDozier

Three children with names associated with Hitler's Nazi movement? I don't think it takes much reading between the lines to see what's going on in this family.

Member Avatar for sneekula
2
485
Member Avatar for lilballeer

OUCH!!!! Just add scope resolution operator (::) doesn't turn a function into a class member. And the member function shouldn't have to deal with any outside objects, like any particular file. That's not a good implementation of a class method. A method is an action that a class object takes …

Member Avatar for vmanes
0
234
Member Avatar for Duki

Why do your write the number of records to the binary file, but not read it it back? Instead, you're reading in the full (potential)size of the array's worth of data, which will include that one int at the front of it, putting everything else out of sync. This line …

Member Avatar for vmanes
0
153
Member Avatar for vmanes

[URL="http://www.cracktwo.com/2009/05/72-old-computer-ads/"]Fun stuff here[/URL]. How many of these ads do you remember seeing when they were fresh? AD- you don't have to answer!

Member Avatar for vmanes
0
80
Member Avatar for Ancient Dragon
Member Avatar for redmaverick

In the simplest sense, all you need are to modify the #include's to the current C++ forms [code] #include <cstdio> #include <cstdlib> #include <ctime> #include<cstdlib> [/code] Compile and run. C++ will use the C output methods. If you really want to make it all C++, you'll have to change the …

Member Avatar for vmanes
0
172
Member Avatar for gr8ash

What it looks like you're doing is displaying floats so that they will line up at the decimal point. Your loop to count digits is only counting the whole number portion. If you're trying to mimic the setw( )manipulator, you're going to have to know how many digits fall after …

Member Avatar for ArkM
0
227
Member Avatar for nicolap

I wouldn't call the problem of comparing floating point values for equality "undefined". There's a pretty clear definition of what happens - the two values are compared returning a boolean value. I would describe the procedure as "unreliable", in that two values which may be (ought to be) the same …

Member Avatar for vmanes
0
208

The End.