5,237 Posted Topics
Re: Ah, "show visible tabs" it's called. It you put that into the help system, it should tell you. | |
Re: > So, by now it seems like C++ will be the futures programming language. You have a narrow view of exactly what languages are in common use. [URL="http://en.wikipedia.org/wiki/Cobol"]COBOL[/URL] and [URL="http://en.wikipedia.org/wiki/Fortran"]Fortran[/URL] are still hugely popular in their respective fields, and are not going to be dislodged any time soon. Both are … | |
Re: As I understand it, the double-fork ensures that the daemon process becomes a child process of init, which never exists. | |
Re: > scanf("%s", &retry); First buffer overflow - retry is a single char, you can't put a string into a single char. Second problem, calling a function recursively just to implement a while loop is poor form. Third, you're mixing scanf() with fgets(), which will surely lead to trouble at some … | |
Re: You mean your googling failed to find any source code you could just use for your homework. This isn't the same as there being no information about compression on the web. There's lots of it. | |
Re: Well your attempts to copy the file fail on both occasions, by duplicating the last record. Using feof() to control a loop is almost always a bad idea, and this is no exception. Do it like this [code] while ( fread(&r,big,1,f) == 1 ) { fwrite(&r,big,1,tmp); } [/code] You HAVE … | |
Re: Dunno, there's been half a dozen or so trolls all posting verbatim copies of wikipedia and other online resources, often in repeated replies to their own messages. The management should conduct a ban and sweep on them. | |
Re: > The reason I cast the struct variables to int is because they start as hex numbers This makes no sense at all. What does this do? [code] int a = 10; int b = 0xa; printf( "%d %d\n", a, b ); [/code] The fact that the constant was written … | |
Re: > int b = 725, c = 750, d = 775, e = 10000; Compared to your other variable names, these are meaningless. > scanf("s%", PurchaseAmount); 1. The % should be first, then the conversion format letter follows. 2. It's d for an integer. 3. You forgot the &, as … | |
Re: C doesn't have anything like say [ICODE]std::vector<std::string>[/ICODE] of C++. So the question becomes how much of it are you going to simulate in C, say using some 'class-like' functions and dynamic memory allocation. | |
Re: If you want it fast, don't use recursion. If you want it faster still, create a local lookup table. | |
Re: Since a bunch of those concepts are somewhat specific to Unix/Linux, you're in for a hard time finding windows equivalents. [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url] | |
Re: Yes, you can. No, it's a bad idea to try. It's a bad idea because the packing and alignment of the data is dependent on the compiler, and the endian-ness of the data is dependent on your architecture. If there is any variance between the sender and receiver, the receiver … | |
Re: Gee, yah think!? [URL="http://en.wikipedia.org/wiki/C%2B%2B"]http://en.wikipedia.org/wiki/C%2B%2B[/URL] Wow, why read it here, fragmented and devoid of links when you can just read the whole wikipedia entry in glorious technicolor. | |
Re: C++ is a programming language, as defined by ISO. VC++ is an implementation of that language, as provided by Microsoft. G++ is another implementation of C++, as provided by FSF. If you stick to using features defined by ISO, then your C++ program should compile with any C++ compiler. | |
Re: It means you should post your code because you screwed up somewhere, and that your fossil compiler was too dumb to notice the mistake. When you use a real compiler, that's when all the problems surface. | |
Re: What is spamming the board with "20 questions" all in a row all about? It's like you found an online quiz and just dumped it here - sheesh! Not to mention the cryptic "kiddie" speak and the "Oh no, not more code posted without code tags". | |
Re: What would be more interesting would be what else is attached to the board which holds the EEPROM, and what kind of tools you've got to hand (for programming in assembler for example). EEPROM is just another kind of memory, like RAM, except it doesn't forget. So programming it is … | |
Re: > I want to make a program with a max function taking any number of type double > and returns the greatest of them. So store them in an array (or better yet, a vector) and write a function which accepts that array (or better yet, a vector). The first … | |
Re: First off, main returns an int - no exceptions. To compile a multi-file project from the command line, it would be [ICODE]gcc -Wall array.c main.c[/ICODE] Later on, when you want to get into incremental compilation, the steps would be [ICODE]gcc -c -Wall array.c gcc -c -Wall main.c gcc array.o main.o … | |
Re: 1. Neither of you read [URL="http://www.daniweb.com/forums/announcement14-2.html"]THE ANNOUNCEMENTS[/URL] 2. You bumped a year old thread just to say "gimme gimme gimme". 3. The OP has never bothered to return, so I'm guessing your plea is falling on deaf ears. Now are you going to try and do your own homework to … | |
Re: Well that would depend on your OS/Compiler and the type of program you're creating (say console or GUI). | |
Re: Well assuming all your strings are going to fit into 100 characters, the first thing you need to do before using strcat is to make sure the string is empty. malloc returns memory which contains garbage, so begin with word[0] = '\0'; Then you try to append a single character … | |
Re: There are a couple of things wrong (probably more). 1. You can't return an array, no matter how you declare your return type, because you're only returning a pointer to the array, and the array goes out of scope when the function exits. You can get round this by making … | |
Re: > `grade(void);` It's just `grade();` Next time, use the code-tags. Between joining the forum and posting your first message there are many opportunities to learn how to do this, and you failed all of them. | |
Re: Start small, say with a program which just reads user input and prints it straight back to the user. End the program with the input of a $ as per your specification. Then think about your line statistics, maybe with counting vowels, then calculating the averages. | |
Re: It's just a filename. It says nothing about how you open the file. | |
Re: Yes you can, but the answer depends on your operating system and compiler. This better not be another "OS=XP and Compiler=TurboC" question. Some background reading when you've told us more about what it is you actually want. [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] | |
Re: Study the interface which fgets() provides. | |
Re: In octal, it would be unsigned char foo = 032; // a leading zero. You can't specify binary constants in standard C, though some compilers designed for small embedded processors do as an extension. | |
Re: Well RTF files are just HTML, only different. That is, a text file which contains the presentation information as well as the content, in an easy (relatively speaking) text file. Start by putting "rtf file format" in your favourite search engine. | |
Re: What a horrible unformatted mess that is, which is only good for a DOS compiler for one specific year. | |
Re: Then post your code so we can help you. Don't forget to use the CODE tags when you post it. | |
Re: Well if you posted the actual error message, we can tell you what is missing, and where to start looking. | |
Re: You'd be amazed how much "rough code" makes it through to production. Get it right first time, then you won't have to say "I'll fix it later, promise", then fail miserably to back up your statement. The same goes for indenting, commenting, structuring etc. It takes less time to do … | |
Re: Why did you add 'binary' to the input mode for a text file? Before you get into calculations, just make the program print out what it read in. If it can't do that much properly, then there isn't much point with the rest of the program. You also need to … | |
Re: Read each line using fgets(), as in [code=c] char buff[BUFSIZ]; while ( fgets( buff, sizeof buff, fdin1 ) != NULL ) { if ( sscanf( buff, "%s %s %s %s %s",data1, data2, data3, data4, data5) == 5 ) { // could be a line like // 00:00:00 R- 0.0654 345 … | |
| |
| |
Re: > cin.get(movieTitle[j], 50); This stops when a newline is found. > cin >> rating[i]; This leaves a newline on the input stream, thus screwing up your get() call the next time around. Look into using say cin.ignore(). Mixing input methods almost always leads to problems such as "missing or skipping … | |
Re: > [ICODE]int noofgamesplayed;[/ICODE] [ICODE]noofgamesplayed++;[/ICODE] Is using it without it being defined. [ICODE]cout << "You played " << noofgamesplayed << " games";[/ICODE] Is also using it without it being defined. [ICODE]int noofgamesplayed = 0;[/ICODE] Now we're cooking!. | |
Re: > char *dummy; Well you're spraying random data all over memory with your scanf calls, so the code is broken before it's begun. Is it me, or is every single case of your find_solution() identical, except for one line? Consider simplifying the code if this is the case. You're also … | |
Re: Sounds just like what the debugger in visual studio is capable of doing. | |
Re: [url]http://en.wikipedia.org/wiki/Fourier_transform[/url] Finding a library which does this for you would be a really good idea. Essentially, you want to take your sample set, which is in the time domain, and turn it into something in the frequency domain. As for recording your sample, state your OS and compiler for more … | |
Re: So you want to omit the team tag, and everything which is inside it? | |
Re: Read these topics at the top of the forum. Announcement: We only give homework help to those who show effort Announcement: Please use BB Code and Inlinecode tags |
The End.