Search Results

Showing results 1 to 40 of 1000
Search took 0.12 seconds.
Search: Posts Made By: Narue ; Forum: C and child forums
Forum: C 12 Hours Ago
Replies: 2
Views: 66
Posted By Narue
>I can't see any other way to pass the ... arguments, other than
>through the "va_list args" and va_start lines, am I wrong in thinking that
Nope, you're right on track.
Forum: C 15 Hours Ago
Replies: 2
Views: 101
Posted By Narue
>Can someone explain me what does this mean?
>"40[^\"], %*c"
Assuming it's actually "%40[^\"], %*c", it means read a string of up to 40 characters or until a double quote is found (%40[^\"]), then...
Forum: C 1 Day Ago
Replies: 1
Views: 103
Posted By Narue
>Now the question is how the Assember was implemented, i mean which language?
Any compiler can be written in a suitable existing language. The first assembler was probably hand compiled as machine...
Forum: C 4 Days Ago
Replies: 4
Views: 191
Posted By Narue
>new_node->first->next = my_list->first;
my_list is a type, not an object. Perhaps you meant:

new_node->first->next = my_this->first;
Forum: C 4 Days Ago
Replies: 4
Views: 191
Posted By Narue
Your code is C++, not C. In C++ void* conversions are not implicit and require a cast.
Forum: C 4 Days Ago
Replies: 12
Views: 377
Posted By Narue
>lets say m=2, n=2 => calls m=1, n=1 => m=0,n=0 which returns num_elements =0
>control comes to fn m=1, n=1, num_elements get incremented and returned.
>control comes to m=2, n=2, num_elements get...
Forum: C 4 Days Ago
Replies: 1
Views: 155
Posted By Narue
No code, no help. Read our rules.
Forum: C 4 Days Ago
Replies: 1
Views: 149
Posted By Narue
Five days, huh? Maybe you aren't cut out for programming? Post your code and somebody will try to help you.
Forum: C 4 Days Ago
Replies: 8
Views: 238
Posted By Narue
>but still compiled and ran without incident..
Yet another ding against gcc for not conforming to the standard, I suppose. Those switches put the compiler in strict conformance mode, which means a...
Forum: C 4 Days Ago
Replies: 8
Views: 238
Posted By Narue
>I tried compiling this with the GCC compiler and its works...
Try again with the -ansi, -pedantic, and -Wall switches.
Forum: C 4 Days Ago
Replies: 8
Views: 238
Posted By Narue
>whats the story.
The story is that the code you posted is not valid C. You're likely relying on a compiler extension that allows nested function definitions. What compiler are you using?
Forum: C 4 Days Ago
Replies: 12
Views: 377
Posted By Narue
>i understand recursion, [but my] basic doubt is <blah blah>
That doubt is precisely why I don't believe you understand recursion. So why don't you explain how recursion works to me, using a common...
Forum: C 4 Days Ago
Replies: 4
Views: 256
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 5 Days Ago
Replies: 12
Views: 377
Posted By Narue
If you don't understand recursion, trace through the execution and see exactly what happens:

#include <stdio.h>

int function ( int m, int n )
{
int num_elements = 0;

printf ( "Entering...
Forum: C 5 Days Ago
Replies: 7
Views: 330
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 5 Days Ago
Replies: 1
Views: 169
Posted By Narue
Q: Do you know how to do it on paper?
(a) No: Go figure that out before trying to write code.
(b) Yes: Show us your code, and be more freaking specific about what problem you're having.

Since...
Forum: C 5 Days Ago
Replies: 4
Views: 221
Posted By Narue
>it won't work the way i want it
So fix it. We're not the psychic friends network, here to solve all of you problems with a crystal ball and smile. You wrote the damn program (and it's very short!),...
Forum: C 5 Days Ago
Replies: 4
Views: 256
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 6 Days Ago
Replies: 12
Views: 377
Posted By Narue
>num_elements is returned by each call recursively, will it be
>overwritten with the local variable , from the calling function ?
num_elements is returned, but never modified except to increment...
Forum: C 6 Days Ago
Replies: 2
Views: 201
Posted By Narue
>Is there any suggestion for improvement
Yes, I can recommend improvements:

>scanf("%d",&n);
Always check your input functions for success. Especially with user input, and more especially with...
Forum: C 6 Days Ago
Replies: 12
Views: 377
Posted By Narue
In your current code you declare num_elements both in the global scope, and locally within main. When multiple variables from different scopes have the same identifier, the one from the most local...
Forum: C 7 Days Ago
Replies: 7
Views: 287
Posted By Narue
That makes more sense. In the future it would be nice to include those defines in the code, if only to make life easier for the people helping you.

Anyway, your algorithm is somewhat nonsensical....
Forum: C 7 Days Ago
Replies: 4
Views: 273
Posted By Narue
>The serial number of motherboard must be obtained.
>How to do it under Windows ?
WMI FAQ (http://technet.microsoft.com/en-us/library/ee692772.aspx).
Forum: C 7 Days Ago
Replies: 7
Views: 287
Posted By Narue
>Actually it does compile.
TYPE is never defined, which causes a relatively large number of errors regardless of which compiler one uses. You also rely on non-portable behavior that breaks two of...
Forum: C 7 Days Ago
Replies: 11
Views: 7,253
Posted By Narue
>The better method as per me is
You do realize that the same solution was suggested in this thread three years ago, yes? :icon_rolleyes:
Forum: C 7 Days Ago
Replies: 3
Views: 215
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 8 Days Ago
Replies: 4
Views: 217
Posted By Narue
>the compiler is actually giving an error though -- "invalid operands to binary *"
The compiler is actually right. Multiplication for pointers is nonsensical. Why don't you tell us what you're...
Forum: C 8 Days Ago
Replies: 3
Views: 233
Posted By Narue
>And here int edadMedia(struct persona * nombres) { }
>i wanted to create a pointer to an array of structs
That close to what you said, and personally I think it's what you really meant. When you...
Forum: C 8 Days Ago
Replies: 6
Views: 220
Posted By Narue
>Because the OP created the arrays without a size.
And without a type. Are we also to assume that he wants a variant type?

>You're the first one in this thread to be rude.
If you think that's...
Forum: C 8 Days Ago
Replies: 6
Views: 220
Posted By Narue
>With two dynamic arrays, your structure needs pointers to the arrays.
You're the first one in this thread to mention dynamic arrays. Why over-engineer the problem and confuse the OP?
Forum: C 8 Days Ago
Replies: 6
Views: 220
Posted By Narue
>array1[];
>array2[];
A type and a size are both required.

>length;
A type is required.

>name1.array1[4] = {3,0,7};
>name1.array2[4] = {0,15,0,-4};
Alas, arrays can't be assigned to like...
Forum: C 8 Days Ago
Replies: 3
Views: 233
Posted By Narue
Use nombres the same way in edadMedia as you did in main (ie. as an array). However, I strongly recommend that you pass the size of the array as well so that you can avoid bogus indexes in edadMedia....
Forum: C 8 Days Ago
Replies: 3
Views: 227
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 23 Days Ago
Replies: 16
Views: 579
Posted By Narue
>I don't really see your point....
That much is obvious.

>Is your point that is not 100% the standard?
My point is that it could potentially be the cause of your problem because a compiler is...
Forum: C 23 Days Ago
Replies: 16
Views: 579
Posted By Narue
>Maybe I'm having problems with this statement
>"the result shall compare equal to the original pointer"
It means that you can convert an object pointer to or from a void pointer without any loss...
Forum: C 23 Days Ago
Replies: 16
Views: 579
Posted By Narue
>Could you give an example....
Your code is an example, my fix for your code is a counter-example. What more do you want? How about a quote from the standard:

The key terms here are incomplete...
Forum: C 23 Days Ago
Replies: 16
Views: 579
Posted By Narue
>No the complier had no problems casting a void pointer to a function..should it?
It might. Technically void* and functions pointers are incompatible and converting between them is undefined...
Forum: C 23 Days Ago
Replies: 5
Views: 236
Posted By Narue
C doesn't specify tab stops, only tab characters. It's up to the program consuming those characters to interpret the character with a certain tab stop length, just like it's up to the same program to...
Forum: C 27 Days Ago
Replies: 5
Views: 236
Posted By Narue
>i spent lot of time in googling but couldnot get it.
Hmm, perhaps that's because it's copyrighted and any free PDF you find is illegal? If you want the book that badly, go buy it. If you can't...
Forum: C 27 Days Ago
Replies: 1
Views: 228
Posted By Narue
>Please help me find the mistake!
I suspect the mistake is a complete failure to study whatever book on C you have. Instead of trying to finish this exercise in one swell foop, perhaps you should be...
Showing results 1 to 40 of 1000

 


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

©2003 - 2009 DaniWeb® LLC