1,362 Posted Topics
Re: Yeah, if it had GPS and some processing power, you could plot out your yard and let it run autonomously. Hmmm, sounds like a project for students at my school. My yard has lots of slopes, and odd shapes. This could be fun! | |
Re: With VMware you should be able to set up a shared "drive" on the host. But, your guest VM should have an IP, unless you set it up to share the host's. There is a NAT option in VMware. I don't have my VMware machine handy, or I'd give more … | |
Re: A. Use the tags for code inclusion [noparse] [code] some code here [/code][/noparse] B. Format your code for better readability - indenting, whitespace between operators and operands. You're not charged by the byte. C. Give a clear explanation of what seems to be going wrong, and where! D. Your title … | |
Re: First off, the logic of testing for eof( ) before having read anything can cause your input/output to be off a bit - consider a dead empty file, and consider what happens after you read the last valid line in the file. This topic has been disussed many times in … | |
Re: I think this study does not necessarily pertain to the world at large. Consider that it's only looking at people using MSN IMs - that's kind of a closed pool. And it's a group that has self selected themselves to be very chatty. I think the term for all this … | |
Re: Springboarding off AD's comments, yes, the string type can hold a really large string. However, reading and storing long string data to it could be time consuming. String allocates a small data area at first, and keeps adding to that as needed. It may be the case that every time … | |
Re: Simply run your column loop as outisde loop, the row loop on the inside, like: [code=c++] for( j = 0; j < cols; j++ ) { sum = 0; for( i = 0; i < rows; i++ ) sum += numbers[i][j]; //do something with sum } [/code] Note that even … | |
Re: That error message is one of the clearest there is. The problem is, if the user immediately chooses NO ( '0' ), you skip the while loop and go on to the summary calculations. [inlinecode]entregas_totales[/inlinecode] gets set to value zero, and is used as a divisor a little bit further … | |
Re: What about Windows 1 and 2? WfW was actually a parallel version of 3.1 and 3.11. Win 7 will probably end up with a GED. | |
Re: [QUOTE=WaltP;659031]sms 2 me tht u hv a prblm. snc we no u so well, we sgst cndl mkg. its mch ezr thn cptr[/QUOTE] Should I be worried that I'm able to read that? Or worried that that's all so many kids these days seem to be able to write? | |
Re: I've used Logitech mice almost as long as they've been making them, and have found them to be easy to use, very reliable. As long as you're mating current products in current OS's, they do work very well out of the box. They have a lot of configurable controls - … | |
Re: MS (and probably other compiler vendors) are revising the string function to ensure greater safety. With strcpy, strcat and their variations, it's very easy to try to stuff more into a string array than it can hold. Therein lies the opening that many malware authors have exploited. You can update … | |
Re: First, what's with all the extraneous "#' symbols? They're only needed for the include statements. To allow the user to continue entering data sets, enclose the main process in a loop, such as [code=c++] char rerun = 'y'; while ( rerun == 'y' ) { //do the work //ask if … | |
Re: [QUOTE=camproject;645045]If I have to get the position of the objects,i have to first identify them is there any way to identify the objects?[/QUOTE] That would seem to be the point of the assignment. It's actually a pretty challenging aspect of computer vision. You several approaches you might take - such … | |
Re: Off and on since 1983 or so. Classes in UCSD Pascal running on original IBM PC, Fortran and OS/370 Assembly on some hidden mainframe, oh, and MS BASIC. Later got a class in C, then C++, which most all I do today. | |
Re: Umm, you did so get answers to your shortest path query. Getting mad won't help you get help here. Google is your friend, in 10 seconds you'd have found a wealth of information on shortest path algorithm and code samples. As to current problem, again, you can find a plethora … | |
Re: I was just gonna post a note like this. It's moving along quite nicely - more than 1.8M additional downloads since I got it this evening. Interesting to see how many, or how few, downloads from various countries - be sure to mouse over the map on the worldrecord page. | |
Re: [QUOTE=maydhyam;629241] [B]So here is another 1 to ponder...[/B] Since bread is square, why is sandwich meat round?[/QUOTE] There used to be a round bread in the UK - does it still exist? | |
Re: In the Project Properties, Configuration Properties, Linker, System, try setting SubSystem to Windows((/SUBSYSTEM:WINDOWS) I've been trying to wrap my head around wxWidgets for a couple weeks now (and doing so on both VC++ and XCode on a Mac) and am getting nothing but migraines. No one seems to put forth … | |
Re: You must also have variables for high and low, initially set to values well out of range (ie, high = -999, low = +999) As each value is read in, compare it to high and to low, updating the appropriate variable as needed. | |
Re: I don't see where you declare member nFactorial, but you've pretty much answered your own question. Data type int or even long will not hold a value beyond 12!. You need to either use type double (good to about 21! IIRC), or, if your system supports it, a long long … | |
Re: What's making your program seem to end early is the fact that you have no loop to keep it playing. You fall from one if clause to the next till you get to the bottom. With a processing loop, you can have just one input block, then determine what to … | |
Re: Without line numbers present (please use code tags in the future), I'm guessing that this line is the offender [code] out<<aStudent.getName<<" "<<aStudent.getSurname<<":"<<endl; [/code] You're asking the program to display the getName function, not the string that it returns. How does it work if you fix it like: [code] out<<aStudent.getName( )<<" … | |
Re: You're on the right track. What you're missing is setting the width of the field in which the values will be displayed, using setw( ) manipulator. The .setf( ) calls don't need to be inside the loop, as they are "sticky" settings. Width, however, applies only to the very next … | |
Re: [QUOTE=Lardmeister;588737]One thing is for sure, the native Americans did not invent the nuclear bomb. Does that make them intellectually inferior?[/QUOTE] No. Perhaps morally superior. | |
Re: Somewhere in the 16 lines above the error, you need to put a { Or, did you really mean to type a ; instead of a : (semicolon versus full colon)? RTFM | |
Re: remove the statement [icode]break;[/icode] that causes your loop to exit after its first pass. what is the purpose of the max variable? It gets reset to zero every loop iteration, so it really serves no purpose. | |
Re: [QUOTE=Ancient Dragon;590283]knewc: line 20: you can't reverse the string using the same charcter array as the original string. You need to use a second array. That's the purpose of [b]new_string[/b]. And use the = operator, not +=. [/QUOTE] You can reverse a string in place by exchanging the characters at … | |
Re: sounds like you need to write your own version of the strcmp() function, where it returns the index at which strings vary rather than just the indicator of which ordering they have. You'll have to examine the stings char by char till a difference exists or you reach the NULLs. | |
Re: I think that's way to simplistic a measure. Shouldn't the average time to resolution be a factor? What if no problems are reported at all - can you still be called successful? Is there some other means to measure the service provided? System uptimes, training provided to customers? Do you … | |
Re: Can you verify that in fact more than one record is in the output file? Check it's size in bytes, or open it in an editor. You should be able to see the text strings entered- are they all there? I can't find anything wrong with the writing or reading … | |
Re: I think you need to clarify your problem. It looks like you're simulating regular arithmetic by storing digits as array elements, and doing the math, but we have no way of being sure. | |
Re: using the value 08 - the leading zero indicates it should be treated as an octal value (base 8 number), which has only the digits 0-7. | |
Re: [url]http://www.google.com/search?q=left+operand+must+be+l-value[/url] It would be helpful if you told us on which line the error occurred. I'm guessing it's this one: [code] exams.at(i).total.at(j)+1 = temp; [/code] After reading one or two of the google hits, you should see the error. | |
Re: One of the ideas you should adopt early is "avoid copy and paste" as much as possible. You have the following blocks repeated, with minor changes, many times. [code] i=0; j=0; cout<<"Enter first number "; cout<<endl; cin>>num1; game[i][j]=num1; i++; game[i][j]=num1; i++; cout<<"Enter second number "; cout<<endl; cin>>num2; game[i][j]=num2; i++; game[i][j]=num2; … | |
Re: What's your question? That web address does not look like something I want access. | |
Re: [icode]swap(exams.at (i).total.at(j)[min],exams.at (i).total.at(j));[/icode] What's the [min] doing? | |
Re: In your function, test y for being zero, display the error message if it is. What kind of results do you get from this code? Are you getting the values you expect? What type of result do you get when you divide and int by an int? If that's not … | |
Re: How can you be seeing anything when the code above does not compile? '\n' is the escape code for newline (what you get when you press the enter key) 'n' is the character 'en' srand( ) should only be called once in the program, not every time your random_1( ) … | |
Re: You do have [code]#include <fstream> using namespace std; [/code] in your file, right? Note that you misspell myFile in the while loop. And your use of the eof( ) method will give erroneous results in the case that the file is empty. On the other hand, your use of the … | |
Re: you can simply add a counter to the loop that stops when you've displayed the number of characters you need: [code] string::reverse_iterator rit = message.rbegin(); int counter = 0; while (counter < 10 && rit != message.rend()) { cout << *rit++; counter++; } cout << endl; [/code] | |
Re: You could put the switch inside the loop (better as a do...while), let the default case handle the erroneous inputs. What is your if( ) condition becomes the while( ) condition. Val | |
Re: Please post your code, then someone might be able to give some help. We don't do your work for you. Take it one piece at a time. Your project is not a trivial assignment - get the easy parts working then move up to the next parts. | |
Re: Are all the typdef's really needed? I find it hard to follow the bouncing, er, whatever. [code] struct Contribution { string name; double amount; }; const int MAX = 25; const string NAME_FILE = "names.txt"; const string CONTRIBUTION_FILE = "slush.txt"; void InitProgram( Contribution contrib[] ); int main() { Contribution ContributionRec[MAX]; … | |
Re: Why are you reinventing wheels? There are string functions for doing the comparison, for copying one string to another. If the assignment requires you to create your own string functions, you still don't need the two copy functions - one will do. Note that you can send a single row … | |
![]() | Re: [QUOTE=DigitalPackrat;584690]Alright, so I would probably skim through the tutorial once. Also, is QT the way to go, what are other options?[/QUOTE] That depends on where you want to go. If you intend to write only for Windoze, you can write at the API level or you can use the MFC … |
Re: n8makar - congratulations on finding your own solution. I'm surprised the others who responded didn't spot that. Mixing input with the extraction operator ( >> ) and getlline is a frequent source of problems for beginning students, that left over newline causes no end of frustration. Now consider what happens … | |
The End.