5,237 Posted Topics
Re: [url]http://en.wikipedia.org/wiki/Hard_link[/url] With some digging, you might find the Win32 API call which lies behind say [code] C:\>mklink /? Creates a symbolic link. MKLINK [[/D] | [/H] | [/J]] Link Target /D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a … | |
Re: [code] union { double d; unsigned char hex[8]; } x; [/code] Assign you 8 hex bytes to x.hex[0] through x.hex[7]. Whether 40 say goes at the start or the end will need to be determined. Then examine x.d for the floating point value. | |
Re: Recursion is just a loop, therefore whether you choose recursion or iteration is a detailed implementation choice. I'd expect the diagram to look the same in both cases. | |
Re: feof() doesn't do what you think it should do. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351[/url] feof() can only return true AFTER some other operation (say fread) has already failed. But you ignore that fread result, and thus what is left on the failed read is actually the same as the last successful read (hence the … | |
Re: 1. How to title your topics - [URL="http://www.catb.org/~esr/faqs/smart-questions.html#bespecific"]Click Me[/URL] 2. How to format your code - [URL="http://www.daniweb.com/forums/announcement118-3.html"]Click Me as well[/URL] > char *sentance[40]; Drop the * from this line. > strcat(sentance, article[rand()%5] One word at a time, like [ICODE]strcat(sentance, article[rand()%5] );[/ICODE] Repeat calls to strcat for each additional word. > … | |
Re: What's that? [url]http://www.daniweb.com/forums/thread117533.html[/url] An echo? | |
Re: Maybe it's time you used a compiler which is actually compatible with your OS. All this backward compatibility from the days of DOS only takes you so far. If you want to save the screen, you'll need to write the code to do this inside your own program. | |
Re: I'm assuming that the code as you see it in your IDE is nicely indented, and not riddled with smilies, right? [url]http://www.daniweb.com/forums/announcement8-3.html[/url] | |
Re: [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] Take the 'F' and then figure out a better approach to "time management" which does not involve posting such pitiful attempts to get others to do your homework with minutes to go. | |
Re: Almost certainly, but you're going to have to tell us which OS/Compiler you're using. And try to be specific, and not just say "Windows" and "Microsoft" for example. | |
Re: Well did you open the file for output in binary mode? Did you check the sizes of the file on the two different systems was the same? Have you copied a file generated on your Linux box to the windows box, and tried to play that? | |
Re: part1.o: part1.c [COLOR="Red"]part3.o[/COLOR] It needs to do part3 first, because of this. | |
Re: Treat everything for which isdigit() is false as a space, and sum whatever remains? | |
Re: Well on Linux, you could use the nice() function to lower the priority of your process, so that it spends more time doing other things. Windows has a similar feature, a search for 'Priority' through MSDN might prove useful. | |
Re: Hi Dr. Nick. [url]http://en.wikipedia.org/wiki/Fibonacci_heap[/url] | |
Re: "readAccuracy returns" implies that readAccuracy is a function. "call readLimits" also implies readLimits is a function. Plus your pseudo code makes no mention of something named calcArea So, no, I don't think you're quite there. | |
Re: 1. main returns int, not void. 2. //begin program, //end ELSE etc These kinds of comments are generally not useful at all, except perhaps you can't see the whole function on screen at once (by then, you have other problems). But some tutors seem to like them, so if that's … | |
Re: Have you considered using your web browser as your viewing application? | |
Re: > num = new int(size); This only allocates 1 (that's ONE) int, and initialises it to size. Compare with num = new int [COLOR="Red"][[/COLOR] size [COLOR="Red"]][/COLOR]; Oh, and next time you want to dump 700+ lines of code on a forum, consider producing a simplified example which demonstrates the problem … | |
Re: > char *tempPassword = new char; How many characters can you store here before you overflow the amount of memory you've allocated. Also, you need to free this memory at some point. | |
Re: Create a class called 'deck' Initialise it with 52 cards. Implement a function called 'shuffle', which randomises the order of 52 cards. Implement a function called 'deal', which gives the next card in the pack. Calling deal 52 times will give you the whole pack, in a random order. You … | |
Re: Maybe start with reading - Intro threads - how to post code threads - the watermarks at the back of the edit window All of which tell you about using [c[b][/b]ode][/code] tags when posting code. | |
Re: [url]http://www.daniweb.com/forums/thread116609.html[/url] Not so much a hint, but you'll get more help if you post an example which focusses on the real problem rather than merely dumping your current program state. [url]http://www.parashift.com/c++-faq-lite/serialization.html[/url] | |
Re: [url]http://cboard.cprogramming.com/showthread.php?t=88495[/url] You've basically copy/pasted the same error 4 times without first checking that the original copy was in any way good. Compiling is essentially free, so it's fine to do it all the way through your program development, not just when you're ready to run. If you only type in … | |
Re: # void main() main returns an int. # node* head_ptr; An uninitialised pointer. | |
Re: [code]int Convert_Let_to_Num(int [COLOR="green"]number[/COLOR]) { char [COLOR="Red"]grade[/COLOR] = 0; if (([COLOR="Red"]grade [/COLOR]== 'a') || ([COLOR="Red"]grade [/COLOR]== 'A')) { [COLOR="Green"]number [/COLOR]= 4; [/code] Q1: What answer do you expect given that you set grade to 0, then proceed to test it against various letters. Q2: If all you do is assign 1 … | |
Re: So why post it on the C++ forum then? Also, when are you going to figure out code tags. | |
Re: for (int posDivisor = 0; posDivisor <= number / 2; posDivisor ++) { if (number % posDivisor == 0) Modulo zero is the same as division by zero. Both are wrong. | |
Re: [url]http://www.itreviews.co.uk/hardware/h1172.htm[/url] The ADF works well, and the results are saved in a single PDF file for a scan run. So for double sided, you would end up with 2 PDF files, so some s/w to split/join the pages in the right order would be necessary. | |
Re: Everything except float and double store integers only (of varying sizes). The unsigned variants are restricted to positive integers (and zero) only. | |
Re: If you're trying to compile this at the command line, then it would be something like [ICODE]gcc prog.c -l[COLOR="Red"]winmm[/COLOR][/ICODE] where the [COLOR="Red"]winmm[/COLOR] specifies the name of the library to link with, in this case lib[COLOR="Red"]winmm[/COLOR].a | |
Re: > count = count+1; Maybe put this inside the loop/ | |
Re: Is such a thing even possible in C89 without invoking undefined behaviour? | |
Re: & is special to the shell, it means run the program in the background (with only one argument). 1. You MUST check argc before blindly assuming that all of argv is valid. Like for example, checking < 4, and not > 4 like you are doing. 2. If you want … | |
Re: You mean as opposed to any other kind of program which might use pointers? C++ didn't include pointers just for the sake of writing tetris, there are many other uses as well. | |
Re: Sounds just like this thread [url]http://www.daniweb.com/forums/thread115791.html[/url] > if one of the chars is a command line specific char (such as #, &) it must produce an error. Chances are, the shell will have already used it (see other thread) before it gets to your program. Unless you quote your shell … | |
Re: So what? You need to ask much better questions. [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] You've basically dumped your 3 assignments and 3 attempted solutions all into the same thread. Is it even your code? It looks a lot like boiler-plate given out by your tutor. For starters, these should have been 3 separate threads. … | |
Re: Opposite how? A regular program works as advertised, a virus doesn't. A regular program is open about it's functionality, a virus isn't. A regular program doesn't cause damage (usually anyway), a virus usually does. The damage can take many forms, from the machine running a bit slow to complete loss … | |
Re: You need [ICODE]obj3ds* outobject = malloc ( sizeof *obj3ds );[/ICODE] | |
Re: It could be that your code is broken. %lf is not a valid format, so who knows what's going on as it tries to make sense of it. [code] $ gcc -W -Wall -ansi -pedantic foo.c foo.c: In function `main': foo.c:5: warning: ISO C90 does not support the `%lf' printf … | |
Re: > works well. can u clarify this??? They're called "tentative definitions". [url]http://david.tribble.com/text/cdiffs.htm#C99-odr[/url] In C, you can do [ICODE]int i;[/ICODE] as many times as you like, in as many files as you like, and C will turn ONE of them into [ICODE]int i = 0;[/ICODE] and all the rest into [ICODE]extern … | |
Re: > Is struct sfoo aligned? if yes/no why? structs are always aligned. They're usually aligned to match the alignment of the member with the most restrictive alignment. By removing the int, you removed the need to make the struct 4-byte aligned, so it just dropped back to the alignment for … | |
Re: [url]http://www.keil.com/support/man/docs/l166/l166_ln_mapfile.htm[/url] Step 1 is realise that the "compiler" is merely one of a series of tools. Knowing what each one does and how to use it effectively will serve you well in the long run. | |
Re: I want people to stop bumping 3 year old threads with useless "me too" or "gimme the answer" posts which make no actual contribution to the site. But I guess we're both out of luck on that front. In the meantime, begin here [url]http://www.daniweb.com/forums/announcement118-2.html[/url] | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement125-3.html[/url] | |
Re: The first thing I would suggest is you parse the expression from a string (and not user input), and return an expression list (not void, and not in a global). You can then test with [code] LinkedStack in2post( std::string expr ); int main ( ) { std::string expr = "3+7-6/2*8+7="; … | |
Re: Perhaps return smallestIndex instead? > but I keep getting a warning at first then it says fatal error that > variable i hasn't been initialized! How many i variables are in your function - I count TWO. Guess which one you're returning - the uninitialised one. | |
![]() | Re: How many people do you know who's eyesight remains constant throughout their lives? AFAIK, it's a one-shot deal, and if/when your prescription changes you'll be back to needing corrective lenses again. |
The End.