5,237 Posted Topics
| |
Re: Why does invert() also display the result? Shouldn't you just call display() when you're done? Each function does ONE job properly. | |
Re: 16th Oct 2005 was the last post before moorthi showed up. I'm sure the OP found the answer in the meantime. | |
Re: Start chatting to some of the recent graduates. Start with indirect questions which might infer how much they earn, like what car they drive. Then perhaps ask them what they think of the salaries offered by the company. | |
Re: Parsing the file, and producing two lists of files, a 'keep' list and a 'delete' list. Sorting them might be advantageous as well. | |
Re: OK, show us what you can do with the first step, namely showing a single letter on screen. | |
| |
Re: Well perl already comes with a module which uses the expat parser, and I find it to be dead easy to work with. | |
Re: The standard doesn't rule out the possibility that integers can have traps like NaN's, it's just that your implementation doesn't have them. | |
Re: Perhaps because your functions are empty, so they do nothing. Or perhaps because [ICODE]pgyd.vardas[25]=Edit21->Text;[/ICODE] is an array overflow and everything has been trashed so it no longer works. I sense some confusion between a char array and a std::string in your declarations. If you're only looking for ONE string, then … | |
Re: Yes, trivial, what have you tried for yourself ? Read this - [url]http://www.daniweb.com/forums/announcement113-2.html[/url] | |
Re: > It works because each character contains a value It works because you assume the the character set is contiguous, and is basically US-ASCII Read about [url]http://en.wikipedia.org/wiki/EBCDIC[/url] Then read about locales. Using toupper() etc will hide the locale and encoding details from you. > char *str = new char[strlen(text)]; You … | |
Re: > for (int i=0; i<=no_of_blds-1; i++) > bld_info[i]=new double[max_corner_no*2+3]; //*2 because we need x and y coordinates, rest 3 for number This is unnecessary (in fact, I think it should at least have raised some warnings). Assuming the maths is correct in the previous line, you already have a 2D … | |
Re: If you've already done "some" of it, how about actually posting your assignment, the "something" you've done, and an actual question about the issue you're stuck on? > I'm asking for help.. Help is what we could have done, had you arrived when you got the assignment. What you're really … | |
Re: Begin by writing some list functions, and not inlining all the code in main. Say these prototypes [ICODE]str_pair *listInit ( void ); str_pair *listAppend( str_pair *list, str_pair item );[/ICODE] The first one initialises the list (easy). The second one makes a copy of item (read up on 'new'), appends the … | |
Re: [url]http://www.daniweb.com/forums/announcement125-2.html[/url] You've posted your assignment, but nothing of what you've achieved so far. Even if you think you're completely stuck, look back at previous assignments and course notes. At the very least, begin with something to use the provided functions to read an int, then just print it out again. | |
Re: Great, perhaps next time you could read the forum rules of posting formatted code before dumping such a huge mess on a message board. | |
Re: [url]http://www-2.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html[/url] | |
Re: Well your first C code was good. Inside the while loop, do something like [code] if ( strncmp( s, "help", 4 ) == 0 ) { // do the help command. } [/code] | |
Re: Some snippets [code] double myInchesArray[5]; scanf("%lf", &myInchesArray[2] ); // now read about loops [/code] Declare a function [ICODE]void foo ( double inches[] ); [/ICODE] Call a function [ICODE]foo ( myInchesArray);[/ICODE] Define a function [code] void foo ( double inches[] ) { } [/code] | |
Re: If you're at the end of file, then infile >> ch will return end of file, and ch will remain unchanged. So you get whatever char you last successfully read repeated for all the times input fails. Like this IIRC [code] if ( infile >> ch ) { } else … | |
Re: Declare a couple of data structures for say - the alphabet - the state Then read the file into instances of alphabet(s) and state(s). That would be (as you put it) a start. | |
| |
Re: Push/pop HTML entities, not characters (perhaps) You're matching <BODY></BODY>, not <BODY></YDOB> | |
Re: Which compiler are you using on XP? Because it seems you're using some ancient fossil DOS compiler. The "DOS Compatibility" will only take you so far, so it seems you've run out of luck. | |
Re: Does your algorithm work? I would say given the nature of the question and the material you've covered so far that a simple brute-force approach is perhaps what is wanted. | |
[url]http://www.daniweb.com/forums/memberlist.php[/url] Can the solved threads column be made sortable, like all the other columns of information? | |
Re: Use fprintf() if you want to print anything other than a string of characters. | |
Re: [CODE]find . - type f | awk -F/ '$NF > 10 && length($0) > 240 { print "Bad\n" }'[/CODE] | |
Re: I read the title, and thought it was someone looking for help with fishing, but instead found someone fishing for help ;) | |
Re: Also spammed here - [url]http://www.daniweb.com/forums/thread122051.html[/url] and here - [url]http://cboard.cprogramming.com/showthread.php?t=102580[/url] and probably a bunch of other places as well. In other words, already failed lesson 1 [url]http://www.catb.org/~esr/faqs/smart-questions.html#forum[/url] | |
Re: A phrase oft repeated AD :) [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] | |
Re: Does anybody ever bother to review their posts before pressing submit??? Code tags!!!!! | |
Re: So use a std::string to evaluate the string concatenation, then return what that produces. You'll also need the run-time equivalent of _T as well. | |
![]() | Re: I usually slap them with [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] if they break too many rules in the same post. ![]() |
Re: [ICODE]awk '$1>=1 && $1<=120' file[/ICODE] | |
Re: Perhaps if you used a while loop, instead of a goto, you could get out of that loop in a sensible manner rather than calling exit(). Which by the way will skip your attempt to PAUSE the display. | |
Re: Three key lines [ICODE] int numStudents = 0;[/ICODE] [ICODE]vector<int> student_score(numStudents);[/ICODE] [ICODE]cin >> numStudents;[/ICODE] Now, how long is student_score really? You get how many there is at the time you ask. It doesn't create a reference which tracks all future changes to numStudents. Rearrange the order of statements so objects which … | |
Re: > fgets(user_input,sizeof(input),stdin); What is input in this context? It's more usual to write [ICODE]fgets(user_input,sizeof(user_input),stdin);[/ICODE] | |
Re: [url]http://www.daniweb.com/forums/thread121175.html[/url] | |
Re: Which kind of filing did you have in mind? [url]http://en.wikipedia.org/wiki/Filing[/url] Also, "help" is not a topic title. [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] | |
Re: [url]http://www.compilers.net/[/url] [url]http://www.thefreecountry.com/compilers/cpp.shtml[/url] > Also which one is the best compiler? A topic of endless debate :) | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: I'm sure it is, but that doesn't mean we'll be any faster. On the contrary, we tend to ignore such pleading. [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] First couple of problems 1. Your indentation needs a lot of work. 2. if(original_position=56) Use == for comparison, = is for assignment. 3. char pawns[]={0}; If you want … | |
Re: And what is your QUESTION? You've listed the tradeoff - memory vs. convenience, so now you can make a choice. | |
Re: Yes, someone else asked this less than a month ago. Perhaps you both go to the same college and get the same pointless assignments from the same tutor. | |
![]() |
The End.