Forum: C 1 Day Ago |
| Replies: 4 Views: 173 "We only give homework help to those who show effort (http://www.daniweb.com/forums/announcement118-2.html)" |
Forum: C 1 Day Ago |
| Replies: 3 Views: 114 My apologies, my advice was not very good. Your original solution is very close but with a few minor tweaks.
Your main should include this (note that N is no longer defined as a pointer and you... |
Forum: C 1 Day Ago |
| Replies: 1 Views: 101 |
Forum: C 1 Day Ago |
| Replies: 3 Views: 114 int main()
{
int *a, *N;
Input(a,&N);
Display(a,&N);
getch();
return 0;
} |
Forum: C Apr 20th, 2009 |
| Replies: 8 Views: 344 Oh wow, I forgot about the second call myself. Jepthah: point taken. |
Forum: C Apr 19th, 2009 |
| Replies: 8 Views: 344 "Being cute" was not my intention. I was thinking of efficiency at the time. And while I appreciate the suggestion, it doesn't help my immediate problem. |
Forum: C Apr 19th, 2009 |
| Replies: 6 Views: 510 I hate to sound like a prick but... using fscanf is generally a bad idea. There are plenty of reasons, but a big one is that most people don't really understand what its doing. Therefore it usually... |
Forum: C Apr 19th, 2009 |
| Replies: 9 Views: 1,093 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. |
Forum: C Apr 19th, 2009 |
| Replies: 6 Views: 510 fgets (http://cplusplus.com/reference/clibrary/cstdio/fgets/) and strtok (http://cplusplus.com/reference/clibrary/cstring/strtok/) would be good places to start. Do you know how many strings you will... |
Forum: C Apr 19th, 2009 |
| Replies: 8 Views: 344 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--
#include "stdafx.h"
#include... |
Forum: C Apr 2nd, 2009 |
| Replies: 4 Views: 911 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:
int r, c;
int arr[numRows][numCols];
while(/*there's another... |
Forum: C Apr 1st, 2009 |
| Replies: 4 Views: 430 Lets just take a look at this code: ptr=n*(malloc(sizeof(n));
ptr=head;
scanf("%d",&ptr->data);
head=ptr->data;
ptr=ptr->next;
You don't need line 1 because you just set it to point to a space... |
Forum: C Apr 1st, 2009 |
| Replies: 18 Views: 1,370 Just a tip: since you are reallocating new memory when you run out of space, you probably want to use realloc (http://cplusplus.com/reference/clibrary/cstdlib/realloc.html). This will keep all the... |
Forum: C Mar 30th, 2009 |
| Replies: 10 Views: 663 Ark's approach is much neater and most likely works. Your solution is very hard to read; the looping approach makes more sense. |
Forum: C Mar 30th, 2009 |
| Replies: 10 Views: 663 Purely for the sake of simplicity, I would go with this route (doesn't use a second set of variables):
int main( int argc, char *argv[] ){
int *numberlist, i, n, min, max ;
n = atoi(... |
Forum: HTML and CSS Mar 25th, 2009 |
| Replies: 5 Views: 823 I am modifying a myspace page so the only tag I added is the <style> tag shown above. |
Forum: HTML and CSS Mar 23rd, 2009 |
| Replies: 4 Views: 1,001 I tested it myself and it worked regardless of the resolution. What browser did this occur in? |
Forum: HTML and CSS Mar 23rd, 2009 |
| Replies: 5 Views: 823 Firefox has beaten out IE (thankfully) but there is still too large a demographic of IE users to just ignore. Opacity hasn't quite caught on as standard yet (I doubt anything will for IE) so the... |
Forum: HTML and CSS Mar 22nd, 2009 |
| Replies: 5 Views: 823 I have designed my page using Firefox and it looks exactly as I would expect it to, colors consistent with my design using Photoshop. When I view the page in Internet Explorer, all the colors are... |
Forum: HTML and CSS Mar 20th, 2009 |
| Replies: 2 Views: 448 There is not a way I know to do this with plain old HTML. Are you using ASP or PHP? You can force the browser to request download rather than just opening the file using some header info. |
Forum: C Mar 19th, 2009 |
| Replies: 6 Views: 475 Are you trying to emulate a DOS environment using C? Post the relevant code you have already, what it is supposed to do, and what it is doing wrong. |
Forum: HTML and CSS Mar 19th, 2009 |
| Replies: 3 Views: 599 Not really. Removing the "px" changes nothing. And 0px really doesn't make sense to you? How else should you remove a border inherited from lower down in the cascade? |
Forum: HTML and CSS Mar 17th, 2009 |
| Replies: 3 Views: 599 I need to have my background image span the entire length of the page without using the BODY element, here's why: I separated the image into left and right sections so even for different resolutions,... |
Forum: C Mar 12th, 2009 |
| Replies: 4 Views: 351 Sorry, I should have posted the types I defined; REALIZATION is a pointer in itself, so in that aspect the program works. What is the benefit to clearing a block of memory before freeing it though? |
Forum: C Mar 11th, 2009 |
| Replies: 4 Views: 351 Nevermind, I caught it. I didn't free pitches inside randomActualChord(). |
Forum: C Mar 11th, 2009 |
| Replies: 4 Views: 351 My program is getting hung up somewhere in the function evolveRealization and while it is stuck its memory usage is increasing by around 1MB per second! While it is building up generations, it was... |
Forum: C Mar 10th, 2009 |
| Replies: 8 Views: 533 Well this isn't a terribly performance-intensive part of my program, and I have to submit the whole bloody thing by friday, so maybe i'll get to it another time, and post the results if anyone is... |
Forum: C Mar 10th, 2009 |
| Replies: 8 Views: 533 Would that solution be more or less efficient than calling a function like this on the data before writing:
void swapEndianL(unsigned int *x)
{
*x = (*x>>24) |
((*x << 8) & 0x00FF0000) |
... |
Forum: C Mar 10th, 2009 |
| Replies: 8 Views: 533 Is there any way to force fwrite() to write in big-endian format no matter what? I am trying to write a MIDI file and they are always big-endian. Converting every value I write to big endian... |
Forum: C Mar 8th, 2009 |
| Replies: 3 Views: 1,096 |
Forum: PHP Mar 8th, 2009 |
| Replies: 4 Views: 364 If you like finding new functions, you should definitely take a look at the php function reference (http://www.php.net/manual/en/funcref.php). By the way, I love discovering things in languages too. |
Forum: C Mar 8th, 2009 |
| Replies: 3 Views: 1,096 I had forgotten about calloc for the longest time, but I was recently reminded of it. Now i'm curious, what would be the difference between malloc(numElems * elemSize); and calloc(numElems,... |
Forum: C Mar 5th, 2009 |
| Replies: 4 Views: 1,492 For the purpose of adding a one dimensional array works well enough in representing a matrix. For more complicated operations though, it would likely be easier to define a matrix like int... |
Forum: PHP Mar 4th, 2009 |
| Replies: 8 Views: 1,438 To quote myself for emphasis:
In the page inside the iframe, thoroughly check the css file requested. I would make sure it is one of a select number of specific filenames, rather than checking... |
Forum: C Mar 4th, 2009 |
| Replies: 6 Views: 502 No, you don't pass in the filename; you pass an already opened file pointer (FILE *). |
Forum: C Mar 4th, 2009 |
| Replies: 13 Views: 631 That's true. You don't seem to be getting the point here. A string is an array of chars. An array of strings (multiple names) must be an array of arrays of string. Therefore you have the two... |
Forum: C++ Mar 3rd, 2009 |
| Replies: 2 Views: 614 Strings (if you do it the C way) should have a null character ('\0') to show where the end of the string is. Change your definitions to look like this:
char username[15] =... |
Forum: PHP Mar 3rd, 2009 |
| Replies: 8 Views: 1,438 Well since this is a PHP forum, i'll give you a PHP solution. You could pass the css file for the iframe to use in the url like so:
<iframe id="pframe" width="'.$game['iframewidth'].'"... |
Forum: C++ Mar 3rd, 2009 |
| Replies: 1 Views: 573 Read up on common controls (http://msdn.microsoft.com/en-us/library/bb775493(VS.85).aspx). |
Forum: C++ Mar 3rd, 2009 |
| Replies: 4 Views: 315 As soon as I looked at the code, the ugly void main was staring me in the face. Please fix it in your code, so I can rest easier. |