- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 23
- Posts with Upvotes
- 21
- Upvoting Members
- 19
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
255 Posted Topics
Re: [URL="http://www.mega-nerd.com/libsndfile/"]http://www.mega-nerd.com/libsndfile/[/URL] | |
Re: In C, you can use the char data type just like a number and it will automatically convert it to the ASCII value. Here's a minimal example: [CODE=c]int myNum = 'a';[/CODE] myNum would have the value 97 in it. | |
Re: There is a single arithmetic operation you can use to convert the ranges 0-89, 90-179, 180-269, 270-359 into the values 0, 1, 2, 3, respectively. The result represents the quadrant; 0 would be the first quadrant. | |
Re: Your original code is almost right. Just take a look at your structure definition. You want [ICODE]comments[/ICODE] to hold a string, but you have defined it as a single character. That's why you're getting an error with gets. Now, gets won't allocate the variable for you so you'll need to … | |
![]() | Re: There are a few other considerations when using [ICODE]malloc[/ICODE]. The function returns [ICODE]NULL[/ICODE] if memory can't be allocated, so you need to test for that possibility: [CODE]void *mem = malloc(size); if(mem == NULL) // or if(!mem) { // error handling }[/CODE] You also need to free the memory when you're … |
Re: In addition to the XHTML comment, tags need to be closed properly. And is this really the place for yet another PHP tutorial? There are some really great ones out there already. | |
Re: If you really want it simple, I like the "write it yourself" approach as well. Paul Hudson has a nice [URL="http://hudzilla.org/phpwiki/index.php?title=Creating_a_messageboard"]tutorial[/URL]. | |
So I have a table containing various software and a table containing various features. Each software entry need to have a list of features. Here's where it gets tricky: In my application, I need to be able to select a software entry if it has all the features in a … | |
Re: "[URL="http://www.daniweb.com/forums/announcement118-2.html"]We only give homework help to those who show effort[/URL]" | |
![]() | Re: It seems you read all the posts about the problem, but none about the solutions. Computer specs are not the issue. Care to post which compiler you use? |
Re: Why, in any circumstance, would resurrecting a four year old thread to ask a vague question using bad grammar (forget english grammar, I mean C grammar. C doesn't have "commands") be a good idea? Hmmm... | |
Re: [URL="http://cplusplus.com/reference/clibrary/cstdio/fgets.html"]fgets[/URL] will do that. [URL="http://cplusplus.com/reference/clibrary/cstring/strtok.html"]strtok[/URL] will split up this string into its parts. | |
Re: startX and startY should be private or protected. [CODE] public int getStartX() { return startX; }[/CODE] I trust you can write the method for startY on your own. | |
Re: Your hottestDay method does the same exact thing as highestTemp. Which variable represents the current day you are checking? In checkDuplicates, your outer loop will only run once while the inner loop will run 48 times. The variable x will never change from 0. Use your previous for loops as … | |
Re: You don't need to allocate memory for x_transpose. After the line [ICODE]x_transpose= transpose(array,nrows,ncolumns);[/ICODE] x_transpose points to the same block of memory that was allocated for y. You do need to free all of this memory before the program closes, however. | |
Re: [URL="http://lmgtfy.com/?q=java+microsoft+access+database"]http://lmgtfy.com/?q=java+microsoft+access+database[/URL] | |
Re: Where are you initializing vowelCount? Anyway, you could just reuse the vowelNum method and do something like this: [ICODE]return word.length() - vowelNum();[/ICODE] | |
Re: Try using [ICODE]printf("Greetings, human!");[/ICODE] (just a guess, honestly) | |
Re: Why do you need to write this recursively? It would be much simpler with a single loop. Also, recursive methods tend to be much slower and more memory-intensive than their iterative equivalents. | |
Re: Whether you like it or not, every key press involves several method calls to send the key event to the proper object. If you don't want to send data on every key press then you can create a buffer (array) to store key strokes and only send it when the … | |
Re: You can call [ICODE]myGuiWindow.add(component);[/ICODE] from any class as long as it has a reference to the window. | |
Re: This program uses many outdated practices (void main, clrscr, kbhit) and should [U][B]not[/B][/U] be used as an example by anyone. | |
I just wrote a program that plays various drum sounds when certain keys are pressed. It works for the most part but, when two keys are pressed at the same time, only one sound plays. Both key presses are received, however. I am using the Clip class which allegedly supports … | |
Re: Google ("c sound library") returns plenty of good results. You can find tutorials/documentation for any of them. Check out the features to find which library fits your needs best. | |
Re: You will have to use COM objects. MSDN provides a [URL="http://msdn.microsoft.com/library/ms680573%28VS.85%29.aspx"]programming guide[/URL] and a [URL="http://msdn.microsoft.com/library/ms693341%28VS.85%29.aspx"]reference[/URL]. These can be hard to understand so you may want to find a tutorial on google.. | |
I'm not all that familiar with the C syntax rules, I've mostly worked with C++, and I'm having some weird problems working with Visual C 2008. Here's my code: [CODE=c]#ifndef IFF_H #define IFF_H #include <stdio.h> #include <stdlib.h> #define IDS_GROUP "" #define IDN_GROUP 1 #define IDS_CAT "cat " #define IDN_CAT 2 … | |
Re: What on earth do you need a binary counter for in a tic tac toe game? Computers store everything in 8-bit binary. How you refer to the number doesn't make a difference, other than maybe speed. | |
Re: We can help you better if you post the relevant code as well. | |
Re: fgets to get the string, strtok to tokenize it. To do this multiple times, just put your code inside the body of a loop. | |
I can't find, within my project directories, any option to specify where I want my .exe to start in. I want to do this for that sake of .dll and other file references. Any help? | |
Re: It would help if you provided a sample file structure and the output from your program. | |
Re: Next time, please use [URL="http://www.daniweb.com/forums/announcement118-3.html"]code tags[/URL] and edit your original post instead of creating a new one. The solution for your question: simply encase the code you posted in another loop. I'll leave it up to you to figure out the best outer loop for this situation. | |
Re: I am unsure of the efficiency of my method, but I like to use (if using one loop is really a big deal; usually the choice is out of ease): [CODE=c] for(int i = 0; i < ROWS * COLS; i++) { printf("%i ", arr[i/ROWS][i%COLS]); } [/CODE] | |
Re: If you have an assignment to do it with a recursive function, you can't exactly do it another way and expect to get credit, can you? The fibonacci sequence is where each successive number is the sum of the two numbers before it. A recursive function can call itself for … | |
Re: Where exactly are you calling session_start()? And that error just means you have some sort of output (check for spaces, newlines before your <?php tags) before you have called session_start(). If you have to do this, consider output buffering. | |
Re: We can't correctly solve your problem without more information. Post the definitions of your variables and we'll see. | |
Re: Do you have the exact wording of the problem? You [I]cannot[/I] turn an unordered list into an ordered one without sorting it. | |
Re: I would suggest creating at least one function, getPixel, to make your code more readable. Post this new code and i'll try to take a look. | |
Re: Just because you're printing your HTML [I]with[/I] PHP doesn't mean this is a PHP issue... And you can change this: [CODE=PHP]."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b>$phone</td></tr>\n" [/CODE] To this: [CODE=PHP]."<tr><td bgcolor=\"#ffffa0\" style=\"border:solid 1px #666666;\"><b>Tel:</b> $phone</td></tr>\n" [/CODE] Added a space before $phone. Simple. | |
Re: [CODE=C] int main() { int *a, *N; Input(a,&N); Display(a,&N); getch(); return 0; } [/CODE] &N really means "the address of the pointer N". Your code shouldn't even compile because Input() expects an int for the second parameter. So what if Input() returns the value of N? | |
Re: 1. Use code tags. 2. Use time stamps (functions like mktime, date, etc.) this will make comparing dates much easier. 3. Don't declare functions within control structure. Its just a bizarre practice. | |
Re: It would help if you learned some PHP yourself so you could tell which ones are "good" or not. Most of them use a basic structure of storing login info in session variables, but more advanced ones will use database features to log user activity and/or provide protection against session … | |
Re: A search through the WinAPI turned nothing like what you want. My guess is that those are things only XP knows and keeps them secret. I could be quite wrong though. | |
I'm getting an error (unhandled exception writing address so and so) trying to modify a string. It gets weirder though. Let me show what i've got: --Main.c-- [CODE=C]#include "stdafx.h" #include "commands.h" int main(int argc, char* argv[]) { char word[256]; int id; strcpy(word, "move"); strToUpper(word); printf("%s", word); id = getCommandId(word); if(id … | |
Re: [URL="http://cplusplus.com/reference/clibrary/cstdio/fgets/"]fgets[/URL] and [URL="http://cplusplus.com/reference/clibrary/cstring/strtok/"]strtok[/URL] would be good places to start. Do you know how many strings you will be reading? If you don't it will make the array part a little more difficult. | |
Re: Definitely consider using a compression technique. Otherwise, scaling up can cause distortion. Its gross. | |
Re: If you like finding new functions, you should definitely take a look at the php [URL="http://www.php.net/manual/en/funcref.php"]function reference[/URL]. By the way, I love discovering things in languages too. | |
Re: Just a tip: since you are [I]reallocating[/I] new memory when you run out of space, you probably want to use [URL="http://cplusplus.com/reference/clibrary/cstdlib/realloc.html"]realloc[/URL]. This will keep all the data you had copied into your array previously. | |
Re: If you already know how to use strtok, why did you use that in your topic title? Well anyway, I think you want something like this: [CODE=C] int r, c; int arr[numRows][numCols]; while(/*there's another line*/) { for(c = 0; c < 4 /*num cols*/; c++) { arr[r][c] = /*data read*/; … |
The End.