Forum: C Oct 7th, 2009 |
| Replies: 7 Views: 295 you need to post a question if you want an answer. |
Forum: C Oct 5th, 2009 |
| Replies: 7 Views: 295 when you 'getch' you're taking the next character off of the input queue for processing.
this assumes once you've processed it, you're done with it, and will (probably) eventually want to get... |
Forum: C Aug 5th, 2009 |
| Replies: 13 Views: 754 the main() program can often be called by a parent program. 'return 0;' indicates to the caller (parent) that the main() program executed correctly.
so... generally speaking, the main function... |
Forum: C Jul 16th, 2009 |
| Replies: 18 Views: 679 the error is probably due to the fact that 'x' isn't initialized, so it's value is something like negative eleventy thousand, causing your program to crap the bed when it uses it as one of the array... |
Forum: C Jul 16th, 2009 |
| Replies: 18 Views: 679 you got both loops fighting over the same index 'i' |
Forum: C Jul 14th, 2009 |
| Replies: 30 Views: 1,621 this thread is a disaster. :)
you are a patient man, Salem.
. |
Forum: C Jul 13th, 2009 |
| Replies: 46 Views: 1,514 use code tags correctly. and make sure your code is indented. otherwise, it's a ridiculous mess, and no one will want to look at it.
int main(void)
{
// hello, i am properly formatted... |
Forum: C Jul 13th, 2009 |
| Replies: 30 Views: 1,621 |
Forum: C Jul 13th, 2009 |
| Replies: 30 Views: 1,621 yes, you're right.
even though it works for this trivial example, not casting it properly is a bad habit to get into.
the correct way to initialize it is:
char q[16];
char *p = (char... |
Forum: C Jul 13th, 2009 |
| Replies: 30 Views: 1,621 try this:
char q[16];
char *p = &q;
strcpy(q,"abc");
. |
Forum: Geeks' Lounge Jul 9th, 2009 |
| Replies: 43 Views: 2,700 this is no more "my" home than yours. do you see a "mod" bubble by my name? no. i don't even have a "featured" bubble, like you and serkan.
i just am blunt, and have little tolerance for... |
Forum: Geeks' Lounge Jul 9th, 2009 |
| Replies: 43 Views: 2,700 hardly. because then who would i have to beat up on in geek's lounge?
:P |
Forum: Geeks' Lounge Jul 9th, 2009 |
| Replies: 43 Views: 2,700 your post wasnt harsh. it was honest and insightful, and far more gentle than I'll ever be. Mine was harsh. and here's one that's harsher:
The problem is, Serkan is always coming around here... |
Forum: Geeks' Lounge Jul 9th, 2009 |
| Replies: 43 Views: 2,700 there are plenty of people with more rep points than me who haven't been featured. and rep points are just as subjective and arbitrary as being selected to get a "featured poster" bubble. i mean,... |
Forum: Geeks' Lounge Jul 9th, 2009 |
| Replies: 43 Views: 2,700 jesus shut up already. no one gives a flying shit that your best friends didnt get "featured." |
Forum: C Jul 8th, 2009 |
| Replies: 16 Views: 867 this is not your thread to ask basic questions. go open your own thread on how to use IF.
and if you don't know how to use sscanf() -- much less how to look it up (http://lmgtfy.com/?q=sscanf)... |
Forum: C Jul 8th, 2009 |
| Replies: 16 Views: 867 what you have written here is an identifier from a #define'd constant -- not a string.
if it were a string, then you could use sscanf() as Tom Gunn suggested. but he's assumed that you really... |
Forum: C Jul 8th, 2009 |
| Replies: 3 Views: 629 your .NET installation is broken. Unless you're some sort of windows/.NET guru, the chance of you fixing it correctly is small.
uninstall all visual studio and .NET components, reboot, then... |
Forum: Geeks' Lounge Jul 8th, 2009 |
| Replies: 15 Views: 822 $350 a lid?
holy shit, you kids these days.
:icon_rolleyes: |
Forum: Geeks' Lounge Jul 7th, 2009 |
| Replies: 15 Views: 822 i made a mistake. i said the OP who suggested that programmers were stoners was from the u.s. midwest... that's not correct. Menster is apparently from Australia.
so let me make my own... |
Forum: Geeks' Lounge Jul 7th, 2009 |
| Replies: 15 Views: 822 Yeah, and Hempfest is coming up soon. I wonder if Seattle's former Chief of Police, Norm Stamper, will be there speaking on behalf of marijuana legalization/reform.... again.
:D |
Forum: Geeks' Lounge Jul 7th, 2009 |
| Replies: 15 Views: 822 this is a bizarre correlation that you've made, that most programmers are "stoners".
i don't really know many programmers who are "stoners". most of them are intellectual types (or even... |
Forum: C Jul 6th, 2009 |
| Replies: 7 Views: 339 'k' is a pointer. meaning it describes, or "points to," an address of memory.
when you first declare this pointer, there is no memory allocated for it and the address that it points to is... |
Forum: C Jul 5th, 2009 |
| Replies: 12 Views: 540 that's one way to do it. I prefer to use "strtol()", because you can do more robust error checking to see if the user entered a valid number.
but sure... try "atoi()" to get started.
. |
Forum: C Jul 5th, 2009 |
| Replies: 12 Views: 540 fflush(stdin) is totally, utterly, and completely wrong.
never, ever, use it.
learn to parse your input correctly in the first place, and you wont have this problem.
so get rid of scanf()... |
Forum: IT Professionals' Lounge Jul 3rd, 2009 |
| Replies: 6 Views: 712 here's an early reply: get your PhD in post-hole digging.
i mean, jesus.
if you need an internet chat forum to tell you what your career research focus will be, you probably should go on... |
Forum: C Jul 2nd, 2009 |
| Replies: 9 Views: 407 most of these trifling problems will go away when you throw away the P.O.S. Borland/Turbo compiler and get a real C/C++ compiler like CodeBlocks (http://www.codeblocks.org) or Bloodshed Dev C++... |
Forum: C Jul 2nd, 2009 |
| Replies: 3 Views: 822 the answer to your basic problem:
if isdigit(cResponse);
is incorrect. it should be
if (isdigit(cResponse))
{
// do stuff here
}
(1) an if-statement must be entirely enclosed in... |
Forum: C Jul 1st, 2009 |
| Replies: 21 Views: 1,179 or, conversely:
you post your code there, and wait for someone to make it better and hope some guy doesn't expect you to actually learn something, and you can just sit on your ass waiting for... |
Forum: C Jun 30th, 2009 |
| Replies: 21 Views: 1,179 i dont know what you did, but your code is not visible.
so, please use code tags.
put your code here |
Forum: C++ Jun 29th, 2009 |
| Replies: 18 Views: 868 ^ i like that link.
i don't think there's an equation without using summation. i tried to think about it for a minute, but gave up. I'm not really a math guy. :D |
Forum: C++ Jun 27th, 2009 |
| Replies: 18 Views: 868 it's just LaTeX markup tags. any reference will describe the basics
http://en.wikipedia.org/wiki/Math_markup |
Forum: C++ Jun 27th, 2009 |
| Replies: 18 Views: 868 and you don't need a "Big Number Library". you dont even need a long int. 10,000 is easily represented by a regular integer
the way to approach this problem is by summation:
... |
Forum: C++ Jun 27th, 2009 |
| Replies: 18 Views: 868 the formula posted by siddhant is fundamentally flawed. it only appeared to work, because it just happened to be valid for n=2 through n=8. as 'n' increases past 8, the result becomes more and... |
Forum: Geeks' Lounge Jun 24th, 2009 |
| Replies: 75 Views: 4,823 ^ self-deprecating humor only works if there's a clear distinction between the person and the parody.
in other words: when a creepy internet stalker jokes about being a creepy internet stalker,... |
Forum: C Jun 24th, 2009 |
| Replies: 10 Views: 614 EDIT: never mind. find it yourself. (http://lmgtfy.com/?q=mulitple+precision+library) |
Forum: C++ Jun 23rd, 2009 |
| Replies: 10 Views: 458 I say that you should avoid the use of old, non-standard libraries like "conio.h" unless you are explicitly instructed -- required -- to do so.
anyone can quickly learn to use any library... |
Forum: C Jun 21st, 2009 |
| Replies: 4 Views: 459 what salem said.
and, anyhow, if you really want to do this correctly, you will use the standard C library <time.h> (http://www.cplusplus.com/reference/clibrary/ctime/) ... you will make use of... |
Forum: C Jun 20th, 2009 |
| Replies: 10 Views: 1,705 oh, hell, i just cut and pasted his code. i didn't even notice that
:) |
Forum: C Jun 20th, 2009 |
| Replies: 3 Views: 816 um... you pretty much just described the two steps.
$ gcc file1.c main.c
$ ./a.out
what more do you want to do? |