1,362 Posted Topics

Member Avatar for lqdo

ifstream implies ios::in, so the ios::out should be ignored (have no effect) on the call to fopen. Why use binary mode, when you're just reading in characters?

Member Avatar for NathanOliver
0
131
Member Avatar for musique

[QUOTE=StuXYZ;860537]Nothing, in the fact that it actually works, BUT it is a bubble sort and hence very inefficient. [/QUOTE] Nope, it's selection sort. Which is generally a bit more efficient than bubble. And as we discussed several days back, whether any of the n-squared sorts are really inefficient is a …

Member Avatar for musique
0
255
Member Avatar for rob lloyd
Member Avatar for Trinimini

Welcome to DaniWeb You need to look up the getline( ) method. [icode] cin >> [/icode] will only read in one "word" worth at a time - it skips whitespace, grabs displayable characters, stops when it again encounters whitespace. Also, please use the code tags to make your code display …

Member Avatar for Trinimini
0
110
Member Avatar for Crago3

I'm curious about this input method [code] cin >>("%c", &letter); [/code] Looks like you're trying to mix C's scanf( ) method and the C++ cin>>. While it might seem to be working, in fact what it's doing is reading in and storing as if inputting to a char array, which …

Member Avatar for tux4life
0
255
Member Avatar for sailorsun

I think you guys are reading too much into the problem. It simply asks that the program keep track of the lightest and lowest values entered, there is nothing about storing all the values. sailorsun - once you've gotten the number of values to be examined from the user, use …

Member Avatar for siddhant3s
0
118
Member Avatar for jbennet
Re: C++

Well, some mod you are! Don't you see the sticky thread at the top about books? :icon_razz: A good many of the first shown when you search Amazon look like good prospects, like #4 -[i] C++ for Dummies.[/i] #8 - [URL="http://www.amazon.com/Starting-Out-Control-Structures/dp/0321545885/ref=sr_1_8?ie=UTF8&s=books&qid=1240711853&sr=1-8"]Starting out with C++, Gaddis[/URL] is the one I use …

Member Avatar for jbennet
-1
318
Member Avatar for AnujSuper9

Lines 3 & 4 - you create the array buf, then again allocate memory to it? Why using malloc() when you can use the C++ new? You're on the right track, as to return the string you need to allocate with new so the memory exists outside the function's stack …

Member Avatar for AnujSuper9
0
3K
Member Avatar for sneekula

If I did my job as poorly as it seems the bank and auto execs are doing, that is, if 80+ students a term end up knowing less than when they started the term (which often isn't much), would I be getting a bonus and keeping my job? I think …

Member Avatar for vegaseat
0
255
Member Avatar for ankit894u

Please use full words and full sentences to explain what your problem is. We don't do your work for you - read the notices at the top of the forum. When you post code, it's more readable (thus more likely to get a good response) if you use the code …

Member Avatar for ankit894u
0
117
Member Avatar for mickeybr

Suspishio - Outlook is not tied to IE, Outlook Express is. Mickeybr - have you accepted the optional update in Windows for Root Certificate updates? Maybe something's changed in AOL's certificate signer? As to the Outlook data file - do you have a large store of messages? It might be …

Member Avatar for vmanes
0
266
Member Avatar for luutu_amir

We don't do homework for free. We help you to fix and to understand the work you do.

Member Avatar for skatamatic
0
138
Member Avatar for jct3u

The problem says you will read up to 25 values, possibly fewer. A for loop to control the reading is not a good choice. Use a while loop that stops when you run out of data. Your second loop can be a for loop, assuming you kept count of how …

Member Avatar for DemonGal711
0
224
Member Avatar for dinamit875

On my system, this line [code] while ( (int)temp[i]!=13 && (flag==1)) [/code] keeps the program wanting data forever! Why are you comparing to integer value 13? Where do you get that magical number? Better to let the compiler figure out when you've reached the newline, in whatever encoding system is …

Member Avatar for vmanes
0
113
Member Avatar for kelechi96

All a config file need be is a simple text file with the values stored in it that your program will use. The program will open the file, read and heed the values. If the user wants to change those values through the program, then it will have to also …

Member Avatar for jen140
0
14K
Member Avatar for mostafanageeb

Please read the announcements and sticky threads at the top of this forum - there you'll see that we don't do your homework for you. Take a stab at it, post your code, ask questions about the problems you encounter, and we'll help you to find your solution.

Member Avatar for tux4life
-1
98
Member Avatar for AlPhA

Why study XXXXX? Computing does not exist in a vacuum - we write programs to fill some need - a need related to biology, physics, chemistry, social sciences, weather, and so on. You need to have some knowledge of the domains in which you will support.. You will live and …

Member Avatar for schoolsux
1
1K
Member Avatar for Extreme hosts

Ask the question in the Hardware | Networking portion of DaniWeb? Geeks lounge is for entertainment and general conversation.

Member Avatar for jephthah
0
40
Member Avatar for Ancient Dragon

I could say something about how when our current chief executive gets done, that's about all that will be left of a military band to play the song. But I won't.

Member Avatar for GrimJack
0
73
Member Avatar for danishamman

[QUOTE=nucleon;846882]Four bad sorts: bubble sort insertion sort selection sort shell sort[/QUOTE] I wouldn't call them "bad" sorts - it's all relative. In the days when processor speed was measured in MHz, sure, the first three would seem slow for data sets of any considerable size ( how big a problem …

Member Avatar for jephthah
0
229
Member Avatar for Akis2000

Strictly speaking, no. You don't have the #includes, no return statement, no closing curly brace. And the indenting (as displayed here) is not so great - goes in too far and too many levels. If you mean, will it display a certain number of pseudo random numbers,of some specified number …

Member Avatar for Akis2000
0
112
Member Avatar for nschessnerd

Do you really mean mixing managed and native code? Visual C++ is just a compiler, which compiles C++ code. Perhaps if you gave a full piece of code to illustrate the problem? There's not much we can do with just an error message and no context. Crystal balls don't have …

Member Avatar for nschessnerd
0
226
Member Avatar for hurbano

When a cin >> is followed by getline( ), you will need to use the ignore( ) function in between. You normally don't need the ignore( ) between two input statements of the same type.

Member Avatar for tux4life
0
121
Member Avatar for jam7cacci

Your second post looks like you're trying to do Bubble sort. You have the comparison and the exchange OK, it's the looping that's lacking. Look in your textbook, or do a quick internet search and you should find the basic algorithm for this. Post back what you do to improve …

Member Avatar for jam7cacci
0
176
Member Avatar for Nemoticchigga

The main difference between semaphores and accessors/mutators is that semaphores are for signaling some state between threads, which might prohibit the use of accessor/mutator at a given moment in time. A Google search will turn up lots of good links that explain the thread control issue using semaphores, mutex, or …

Member Avatar for ArkM
0
135
Member Avatar for carolinepoland

I don't know why you get that error, your function is calling itself correctly. Perhaps you're getting that error at the point where your originally call the function from your test program? One error, in the if clause, you need to use two | to represent OR, as in [icode] …

Member Avatar for tux4life
0
119
Member Avatar for perumar

I think the point of the assignment is not to create a copy of the string that is reversed, but to reverse the input string. Using a head and a tail pointer, swap the char that each point to, then advance each towards the middle. Be sure to stop when …

Member Avatar for tux4life
0
286
Member Avatar for 1newguy

Also this [icode] char gr = " "; [/icode] and all the similar statements assigning a string to the char variable, such as [icode] gr = "F"; [/icode] will cause errors, as you can't assign multiple characters to a single char. A string (that which is enclosed in double quotes) …

Member Avatar for siddhant3s
0
168
Member Avatar for Dragonsfire

Without the rest of the program, and a puzzle, it's kind of hard to find an error. Do your functions even get called correctly? Does the program crash or just end without (seeming to) solve the puzzle. Send stimulus check for new crystal ball batteries and we might be able …

Member Avatar for vmanes
0
151
Member Avatar for shadowmann2330

Simple solution - change your data type for the number of players to be a char - then the input will take it and your else clause will execute, then the loop goes round again. comments like this [code=c++] //the if statment that plays the game if the user choses …

Member Avatar for ArkM
0
142
Member Avatar for guest7

Showing some code would be helpful. I'm betting you're trying to assign to an array or structure, or trying to pass an array or structure to a function that takes an integer or...could be lots of things.

Member Avatar for tux4life
0
66
Member Avatar for Thinka

Car and Driver Magazine's "article" on Obama ordering GM and Chrysler to halt participation in NASCAR. The story has been taken down, but you can (for a while, anyway) read it on the [URL="http://tinyurl.com/d5jrnq"]cached copy on Google[/URL] This has so many people up in arms! You can screw with our …

Member Avatar for vmanes
0
128
Member Avatar for 1newguy

RTFCM (Read the Full Compiler Messages) Pay attention to matching opening and closing { }

Member Avatar for Barefootsanders
0
122
Member Avatar for Nikhar

Here's a couple links that should help you get started [url]http://www.dreamincode.net/code/snippet921.htm[/url] [url]http://msdn.microsoft.com/en-us/library/ms685035(VS.85).aspx[/url]

Member Avatar for vmanes
0
80
Member Avatar for Lbs Btw.

How does the option chosen in the displayMenu( ) get to the processOption( ) function? For that matter, in displayMenu, your loop control keeps one seeing the menu and making a choice, as long as the choice is valid. Shoudn't that go the other way round? You need to work …

Member Avatar for vmanes
0
108
Member Avatar for GrimJack
Member Avatar for jimbob90

This [icode]for(int i = 0; i = numberofwords; i++)[/icode] is gonna cause problems - you continually set i to be numberofwords, not test i against it. Two strikes - you really need to use the less than operator, and if you did mean equality test, use two equal signs ( …

Member Avatar for jimbob90
0
124
Member Avatar for 18jainabhishek

[QUOTE=18jainabhishek;836540]plz solve this problem [/QUOTE] A - no one is likely to solve your problem for you. You must attempt the solution, show your work, and we'll help you get to the solution you need. B - don't ask a question by replying to an unrelated thread - that's hijacking …

Member Avatar for vmanes
0
92
Member Avatar for samdajam
Member Avatar for The Dude

It's OK, AD - you probably heard it a million times before. If you click the "huh?" link, it will let you download the .wav file directly.

Member Avatar for jbennet
0
125
Member Avatar for snap!

But it does look like nice pseudocode, if you get rid of all the silly asterisks. Take what you've written ( or copied?) and translate that into C++ code. Declare and initialize the variables, start the loop, get data, check the input, process as needed. Keep looping. What's the "quit …

Member Avatar for rahul8590
0
94
Member Avatar for The Dude

Your Brain Usage Profile: Auditory : 58% Visual : 41% Left : 38% Right : 61% Same comments as The Dude received.

Member Avatar for chriswellings
0
275
Member Avatar for shea279

NicAx64: What assurance is there that the OS will in fact write that new, random data to the same physical location on the drive? I think to do this, you have to get the OS to tell you what physical location(s) of the file is (cylinder, track, sector) and then …

Member Avatar for ArkM
0
690
Member Avatar for TriniBabe

Also, writing in something approaching proper English is appreciated. Text- or leet-speak is generally not appreciated.

Member Avatar for Nick Evan
0
75
Member Avatar for cproud21

You'll do it pretty much the same as with plain old int's. A search function must compare the comparable element from the book object with the target sought. So if you ask the user for an author, stored in a string, compare that to the string your getAuthor( ) method …

Member Avatar for vmanes
0
2K
Member Avatar for meistrizy

Two questions. Is the file data in ascending order? What is that for loop inside the first if of your binary search supposed to be doing? If you found that array[middle] is the value you seek, return middle, right there and then. That for loop just spins around a lot, …

Member Avatar for meistrizy
0
140
Member Avatar for pt_solar

What's got you stuck? You pretty much have the problem done. Your last loop is doing the wage calculations and storing them in the correct array. As I read the assignment, you shouldn't be doing output in that loop. As you have it, it's giving a heading that really should …

Member Avatar for pt_solar
0
1K
Member Avatar for NicAx64

IBM is/was more than a PC company. It did sell off its printers, then PC lines to Lenovo in China. But IBM is still Big Blue, doing more in the software and chips arenas. As to the Silicon Valley focus moving to the Far East, especially mainland China, there are …

Member Avatar for GrimJack
0
195
Member Avatar for kahaj
Member Avatar for PRATS 1990
0
101
Member Avatar for blahblah619

For this assignment, I'd assume all input in the file will be valid, that is, nothing that cannot be processed as a floating point value. That said, you could use the extraction operator ( >> ) to read from the file storing directly to a double rather than using getline( …

Member Avatar for vmanes
0
104

The End.