Forum: C Oct 27th, 2009 |
| Replies: 3 Views: 201 Also you are not writing C++ code so all your variable definitions need to be at the top of your functions, before any executable statements.
And for us to follow your code, use proper formatting... |
Forum: C Oct 19th, 2009 |
| Replies: 12 Views: 470 Assuming this was a job interview, I suggest you stay away from any job that asks foolish questions like this. I would not want to work for a company that want it's programmers to use tricks that... |
Forum: C Oct 3rd, 2009 |
| Replies: 5 Views: 415 You need to format your code (http://www.gidnetwork.com/b-38.html) before posting...
No idea what you are asking. Distinct prime factors? Of what? Show us an example... |
Forum: C Aug 1st, 2009 |
| Replies: 5 Views: 411 C'mon guys, the answer is simple.
Because it was designed as a procedural language. Simple as that. |
Forum: C Jul 26th, 2009 |
| Replies: 3 Views: 632 Well, I suppose the first thing you could code is the input function and get that out of the way...
Yes. How to modify your code? Replace the integer data field with your structure data. The... |
Forum: C Jul 2nd, 2009 |
| Replies: 21 Views: 1,179 Enough, people. The facts are
1) fixed code should not have been posted by anyone other than the OP
2) fixed code should not have been improved by anyone unless the OP posted correct code in the... |
Forum: C Jun 29th, 2009 |
| Replies: 4 Views: 529 Your 1st half of the array array[x][0] is never initialized to zero so the values start out with garbage. |
Forum: C Jun 24th, 2009 |
| Replies: 15 Views: 32,062 uRrite. Just another case of some turkey not caring that 100 pages in on a forum might be moot thread. Nothing better to do, obviously. |
Forum: C May 7th, 2009 |
| Replies: 20 Views: 2,107 Simply to verify my thoughts on the subject. |
Forum: C Apr 25th, 2009 |
| Replies: 27 Views: 1,775 Yes. See this (http://www.gidnetwork.com/b-62.html) and this (http://www.gidnetwork.com/b-56.html). Stop using gets()!
Then write C++ instead of C. If you want to write C code you must... |
Forum: C Apr 21st, 2009 |
| Replies: 3 Views: 441 This is a perfectly legitimate question for this forum. It's about reading special key sequences. The hardware is just a red herring in this case :icon_wink:
1B 5B 41 is called an escape... |
Forum: C Mar 23rd, 2009 |
| Replies: 2 Views: 306 |
Forum: C Nov 22nd, 2008 |
| Replies: 4 Views: 610 What he's getting at is variables should be defined only in code files, the .C or .CPP files. NEVER put a definition in a header file. Only the extern goes in the .H file.
The guards are only... |
Forum: C Nov 18th, 2008 |
| Replies: 6 Views: 609 |
Forum: C Nov 1st, 2008 |
| Replies: 9 Views: 828 strcpy(input," "); // You don't need to do this if your next
// line overwrites the value
scanf("%s",&input); // see this... |
Forum: C Oct 26th, 2008 |
| Replies: 2 Views: 444 Hay dear, plz rd the rulz. Esp da 1 abt "Keep It Clean". d@ wil hlp. Da rst uv da rulz iz imprtnt 2. |
Forum: C Aug 15th, 2008 |
| Replies: 13 Views: 2,426 Not necessarily. Without knowing what needs to be done, looking up a function generally is not of much help. After your explanation, your solution is readily apparent.
I'm not really... |
Forum: C Aug 13th, 2008 |
| Replies: 7 Views: 2,959 WOW! 4 pieces of code to choose from! Which one works best? Which to choose to turn in as the assignment answer?
C'mon guys, we're here to help, not do everyone's assignments for them! |
Forum: C Jul 29th, 2008 |
| Replies: 12 Views: 9,598 |
Forum: C May 31st, 2008 |
| Replies: 4 Views: 1,060 It would be best to let us know what O/S and compiler you are using so we don't have to guess, as jephthah was forced to do. They all have different ways to accomplish the task. |
Forum: C Mar 21st, 2008 |
| Replies: 8 Views: 984 |
Forum: C Mar 6th, 2008 |
| Replies: 14 Views: 4,781 It's because you can't create a buffer using a variable as the size:
int buffer = 11;
char name[buffer];
You need something like:
#include <string.h>
#include <stdio.h> |
Forum: C Mar 4th, 2008 |
| Replies: 5 Views: 1,821 abhikkumarbasu, it would really help if you'd read the threads you are responding in. He very definitely said he's using DevC++.
And I've seen other posts that you've offered the exact same advice... |
Forum: C Jan 9th, 2008 |
| Replies: 5 Views: 2,131 Hey guys, the OP said
The definition of a paragraph is not ambiguous. He defined it. |
Forum: C Dec 18th, 2007 |
| Replies: 6 Views: 909 if (cbuff[0] == '#' && cbuff[2] == 'N' && cbuff[3] == 'a' && cbuff[4] == 'm' && cbuff[5] == 'e')
Instead, how about
if (strncmp(cbuff, "# Name", 6)
Next:
strncpy (name, cbuff+8, 6);
name[6]... |
Forum: C Dec 17th, 2007 |
| Replies: 21 Views: 2,651 Ahh, you got the point -- maybe. But then again, maybe not. |
Forum: C Dec 2nd, 2007 |
| Replies: 11 Views: 2,524 The SPACEs in the scanset seem to be the problem. Remove them and see if that works for you.
Also, check out this information on
main() (http://www.gidnetwork.com/b-66.html)
while (! feof(in))... |
Forum: C Nov 6th, 2007 |
| Replies: 11 Views: 2,152 I'm using a different criteria than dangerous. All three are bad coding techniques. One is dangerous. one is haphazard, one promotes disgusting code. All to be avoided. |
Forum: C Nov 6th, 2007 |
| Replies: 9 Views: 1,288 Please use English. It's "here is the source code. Unless your name is Stepin Fetchit,. Thanks. And use CODE tags...
int main (void)
{
char code;
for(code = "A";code <= "Z"; code += 1)... |
Forum: C Oct 28th, 2007 |
| Replies: 5 Views: 659 It doesn't. See http://c-faq.com/expr/evalorder2.html |
Forum: C Oct 18th, 2007 |
| Replies: 4 Views: 646 Exactly. Study this (http://www.gidnetwork.com/b-38.html). |
Forum: C Aug 29th, 2007 |
| Replies: 3 Views: 878 Actually, you don't need to understand allocation at all. The instructions say:
So all you need is an array of 100 lines of 10 columns.
If you know structures, you can create a structure that... |
Forum: C Aug 23rd, 2007 |
| Replies: 3 Views: 1,329 Set a mask to clear the first 3 bits:
int mask = 0x1F; // binary 00011111
newint = oldint & mask; |
Forum: C Jul 9th, 2007 |
| Replies: 14 Views: 2,439 Only Ancient Dragon has the correct answer. You cannot ++ or -- the same variable in the same statement. The C Standard says doing so is undefined and not guaranteed to give the answer you expect.... |
Forum: C Jul 3rd, 2007 |
| Replies: 11 Views: 1,991 Did the OP really need 4 posts that say exactly the same thing? C'mon, people, one post is enough. |
Forum: C Jun 26th, 2007 |
| Replies: 20 Views: 5,092 I don't like the explanation you've received for "undefined behavior". What this means is the C Standard has not defined the operation, and what it is supposed to do. Therefore, any given compiler... |
Forum: C May 17th, 2007 |
| Replies: 2 Views: 668 Also, please read the Rules (http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies) so you can make good posts with useful titles and questions. |
Forum: C Apr 14th, 2007 |
| Replies: 8 Views: 8,203 Yes, you can write either program without strings. Very easily.
As you should with all programs you write... |
Forum: C Apr 13th, 2007 |
| Replies: 9 Views: 1,413 I hate being ignored!!! READ THIS (http://www.daniweb.com/techtalkforums/post343784-7.html)! |
Forum: C Apr 1st, 2007 |
| Replies: 29 Views: 3,337 You know, I just went through this entire thread and saw absolutely no code by Jerry. How can we help if you won't even try anything suggested, and/or won't post what you've tried? |