Search Results

Showing results 1 to 40 of 287
Search took 0.08 seconds.
Search: Posts Made By: Narue ; Forum: C and child forums
Forum: C 5 Days Ago
Replies: 7
Views: 241
Posted By Narue
>I was thinking stdin
The stream in question is whatever input stream you want to clean up in a line-oriented fashion, but yes, it was written with stdin in mind.

>Will it be something like this...
Forum: C 6 Days Ago
Replies: 7
Views: 241
Posted By Narue
>So, in a nutshell, I'm looking for an alternate of the non-standard getch();
Unfortunately, you can't do it in one line without making some assumptions or rolling the whole thing up into a...
Forum: C 9 Days Ago
Replies: 20
Views: 682
Posted By Narue
>I only posted because I agreed with the OP about our instructor.
>Then you proceed to call me a sock puppet...
Exactly. I call it like I see it, and if you have a problem with that, you're...
Forum: C 9 Days Ago
Replies: 20
Views: 682
Posted By Narue
>Why even bother posting when someone is asking for help, you have a very poor attitude.
Pardon? You must have missed the fact that I was the first person to help Mattpd in this thread. You must...
Forum: C 9 Days Ago
Replies: 20
Views: 682
Posted By Narue
>I can vouch for this guy
Yea, that's not suspicious at all. :icon_rolleyes: From past experience, I'm more inclined to believe that you're a sock puppet rather than a concerned classmate.
Forum: C 10 Days Ago
Replies: 5
Solved: File appending
Views: 324
Posted By Narue
>Kindly let me know of alternatives of how I could solve this problem.
You're not actually appending to the file, you're appending to lines in the file, which amounts to inserting into the file....
Forum: C 11 Days Ago
Replies: 20
Views: 682
Posted By Narue
>I am not certain where to start.
Then you should consider switching your major. "I don't know where to start" is equivalent to "I'm not cut out for programming".

>1. Write a C program that only...
Forum: C 12 Days Ago
Replies: 6
Views: 245
Posted By Narue
>notice that the argv that i enter exists in the txt.....
Yes, but is it the same string you're comparing against? Remember that fgets does not strip the newline character. If you're comparing...
Forum: C 12 Days Ago
Replies: 6
Views: 245
Posted By Narue
>if(strcmp(caracter,argv[1]))
strcmp returns a comparison, not a boolean. In other words, 0 is a match and non-zero is a failure to match. Thus, your if statement is reversed. You print the line...
Forum: C 18 Days Ago
Replies: 4
Views: 423
Posted By Narue
>but many books have this specifier.
I hate to break it to you, but many books are written by people who know little more about C than you do. The lesson about %lf is that printf is not a mirror...
Forum: C 18 Days Ago
Replies: 7
Views: 486
Posted By Narue
>If you expect your IDE to come fully featured then it won't be lightweight....
The very definition of IDE implies a text editor, a compiler, a debugger, and build tools. vim is a text editor, not...
Forum: C 19 Days Ago
Replies: 4
Views: 423
Posted By Narue
>i read that the precision of float is 6 digits and double is 10.
No, the precision of float is FLT_DIG and double is DBL_DIG, where both of those macros are defined in <float.h>.

>but it is...
Forum: C 20 Days Ago
Replies: 3
Views: 314
Posted By Narue
inline: Similar to C++'s inline keyword. It gives you the option of telling the compiler that you want inline expansion rather than real function object code. Inline functions are a safer and easier...
Forum: C 21 Days Ago
Replies: 3
Views: 393
Posted By Narue
If you know how to use arrays, and you know how to use FILE pointers, you know how to use arrays of FILE pointers. There's really nothing tricky about it except for the number of files you can have...
Forum: C Sep 20th, 2009
Replies: 3
Views: 283
Posted By Narue
Amazing. You took the time to add underscores so that your formatting wasn't lost and didn't bother to look for some kind of forum tag that would preserve it for you?

>PLEASE help pps!!
Here's a...
Forum: C Aug 30th, 2009
Replies: 3
Views: 550
Posted By Narue
>I'm relatively comfortable with C++ and am taking a class in C for the
>first time. I'm finding it difficult and frustrating to adapt to the new
>language. It's kind of like trying to box with a...
Forum: C Jun 16th, 2009
Replies: 6
Views: 464
Posted By Narue
>Wow! Didn't mean to tick you off lady
You didn't tick me off. Apparently you're not used to my direct style of help.

>Sorry if I offended you in any way.
The only thing that offends me is that...
Forum: C Jun 16th, 2009
Replies: 6
Views: 464
Posted By Narue
>Well, as I said in my original post
Then you should name the function read_data_from_a_file_and_store_it_in_three_arrays rather than CompareIDs. I didn't ask you what your code does, I asked you...
Forum: C Jun 16th, 2009
Replies: 6
Views: 464
Posted By Narue
That function is kind of scary. What exactly is it supposed to accomplish? I'm reasonably sure I can show you a better way to solve the problem.
Forum: C Jun 13th, 2009
Replies: 8
Views: 856
Posted By Narue
>The code compiles though.
What you're seeing is a silent extension where the compiler treats the size of void as 1. GCC is wrong to allow it in pedantic mode as it's a constraint violation in the...
Forum: C Jun 13th, 2009
Replies: 8
Views: 856
Posted By Narue
>You should perhaps try this:
>void* ptr=but_ptr+20;//this is good
Perhaps you should try it first. You have no excuse for giving an answer that will never compile on a conforming C compiler.
...
Forum: C Jun 12th, 2009
Replies: 10
Views: 1,081
Posted By Narue
>but is there a equation to change the characters hex to decimal because
>sometimes if a string got F or A it will just change that to its ascii value.
There is a compact and easy way to do what...
Forum: C Jun 12th, 2009
Replies: 10
Views: 1,081
Posted By Narue
Treat it as a variation of K&R's atoi. You should already know that you can step through the string and add the characters like so:

result = radix * result + digit;

If radix is 16, you're...
Forum: C Jun 9th, 2009
Replies: 18
Views: 868
Posted By Narue
>As I can say "Build an operating system." is a single step
It is, but you have to increase the granularity of your steps to come up with reasonable milestones. I find it somewhat humorous that you...
Forum: C Jun 9th, 2009
Replies: 18
Views: 868
Posted By Narue
>Enlighten me how?
Step 1: Fill the array using rand.
Step 2: Check for zero and if not present, add it to the end.
Step 3: Randomly shuffle the array.

Apparently you have an extremely limited...
Forum: C Jun 9th, 2009
Replies: 18
Views: 868
Posted By Narue
>That can complicate things.
Duh. It is an extra step, after all. :icon_rolleyes: On the plus side it adds another level of randomness.
Forum: C Jun 8th, 2009
Replies: 18
Views: 868
Posted By Narue
>For the 20th value, if a 0 was not generated, load
>a 0, otherwise get one more random number.
So if 0 was not generated, it'll always be the 20th value? I'd suggest a final step of randomly...
Forum: C Jun 2nd, 2009
Replies: 5
Views: 663
Posted By Narue
>when i tried aux=aux->prox
...aux becomes invalid because aux->prox is an uninitialized pointer. Any further use of aux, except to point it to another address, is doomed to failure.
Forum: C Jun 2nd, 2009
Replies: 22
Solved: help me
Views: 945
Posted By Narue
>Who says using brackets is better?
A lot of people. It's recommended in all coding guidelines I've seen and required in the majority of them. The rationale is that if you add statements to a block...
Forum: C Jun 1st, 2009
Replies: 22
Solved: help me
Views: 945
Posted By Narue
>i am getting three answers for just one bit on
Can you give me an example? Most likely I'm testing your code based on how it's written, not how you seem to expect it to work. In other words, I...
Forum: C Jun 1st, 2009
Replies: 22
Solved: help me
Views: 945
Posted By Narue
Perhaps if you explained exactly what you were expecting and how what you got is different...
Forum: C May 29th, 2009
Replies: 4
Views: 348
Posted By Narue
1) Functionally, in that situation, the two are the same. What you're seeing in the first example is C's comma operator in action. Occasionally you'll see people use it to avoid braces. Whether...
Forum: C May 21st, 2009
Replies: 15
Solved: Using sprintf
Views: 1,270
Posted By Narue
atoi either returns 0 or invokes undefined behavior. But you can't stop the undefined behavior without carefully validating the string before calling atoi. You also can't tell if the 0 is an error or...
Forum: C May 19th, 2009
Replies: 1
Views: 352
Posted By Narue
>do a check to see if the variables exist in my main program
Just how do you plan on doing that? Are you also parsing the code of the main program? If not, do try to remember that variable names are...
Forum: C May 18th, 2009
Replies: 6
Views: 600
Posted By Narue
Might I suggest "%ls" instead of "%s"?
Forum: C May 14th, 2009
Replies: 2
Views: 276
Posted By Narue
>(*hPtr).style = "abc";
You don't copy arrays like this. You also don't compare arrays with the relational operators either. Further, at this point hPtr doesn't point to anything. You need to point...
Forum: C May 14th, 2009
Replies: 23
Views: 1,396
Posted By Narue
>given a function, how do you tell the size of the array that is passed?
Given a function where the only parameter is a pointer to the first element of said array, you don't. There's no portable...
Forum: C Apr 15th, 2009
Replies: 12
Views: 1,268
Posted By Narue
Meh, it's your call.

Let's start with some design decisions:

>void timestamp_string (char * myString)
The first thing I notice is the inconvenient notation caused by returning void. You can...
Forum: C Apr 15th, 2009
Replies: 12
Views: 1,268
Posted By Narue
>le sigh.
:D

It seems you've suffered enough for that bit of code, so I'll restrain myself.
Forum: C Apr 15th, 2009
Replies: 6
Views: 746
Posted By Narue
No, you're supposed to be making changes to the Time function, since that's where the error is and that's where your code is wrong. Allow me to be more hand holdey because you clearly don't get it....
Showing results 1 to 40 of 287

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC