3,183 Posted Topics
Re: > I need to put the function double cos(float) in the trig.c file, but I don't know what to do with it when the function cos() is in there too I'm not sure I understand the problem. You're defining the cos() function *as* `double cos(float)`. There aren't two functions, just … | |
Re: > @haw03013 > > Bullshit What an insightful way to bump a year old thread. Can you elaborate any? | |
Re: Let's use `t[z].suba = a[ w ][ v ];` as the example. Both suba and a have the same type (`float**`), so why are you subscripting a when trying to assign directly to suba? I suspect you're trying to copy the whole matrix: t[z].suba = a; This of course has … | |
Re: > I have got an integer as 0010000001. Just so you're aware, leading zeros are typically truncated as they don't contribute to the value and are conceptually infinite. So your number would be 10000001 unless otherwise formatted to ten digits with leading zeros. That doesn't affect your algorithm, but it's … | |
Re: > i want to show from 100 to 999 but it start at 701 !!! It doesn't start at 701, that's just where as far back as the command prompt allows you to scroll. Try this and use the Enter key to continue to the next "page": for (n1 = … | |
Re: A note on terminology, a char is a single character. You want to split a *string* of char. As for how to go about it, look up [strtok()](http://www.cplusplus.com/reference/clibrary/cstring/strtok/). | |
Re: You can't overload the same operator with the same signature more than once because then the two overloads would be ambiguous. Your best option here is to discard operator overloading and use regular member functions, with the simplest solution being one per task: bool Point2D::lessX(const math& p) { return x … | |
Re: > can we implement these concepts in c using linkedlist and array???? Yes, of course. Though typically when working with anything called a "matrix", arrays are the more natural data structure. For storage efficiency reasons, linked lists become useful when your matrices aren't very full. This is where the sparse … | |
Re: The best way to enhance your skill is through practice. | |
Re: A search for "GMP manual" on Google produced this as the first hit: http://gmplib.org/manual/ All totaled up it took me all of 2 seconds. How hard did you search before giving up? | |
Re: Your question makes no sense. Can you provide a detailed example of what you want to happen? | |
Re: > Is this by design? Yes. The idea is that when you view the first thread in a forum, all subsequent threads are marked read. If you respond to a thread then that thread becomes the first, and by viewing it the marked read logic applies. > My expectation is … | |
Re: Sticky threads are nearly always contributed by regulars of a forum. So if you want a sticky, start a thread with whatever topic you want stickied, then make a moderator aware of it. :) ![]() | |
Re: > Yes. I understand that this is the most impossible thing ever, but is it possible? You think free web hosting is impossible? Have you done *any* research? Seriously, fire up google.com and you'll find no end of free options. They typically limit things like available space or include advertisements, … | |
Re: > is there sometimes excuse for dublicating code? Yes. There's an excuse for breaking any best practice guideline. > So how can you explain - how would I solve my situation which I decscribed I'm not sure I see the wisdom of fixing a pervasive bug in only one place. … | |
Re: > I don't know if it is just me but does the footer look different by any chance? Things are always being tweaked for SEO or user experience purposes. Most of the time nobody notices. ;) | |
Re: Sorry, I can't read Swedish. | |
Re: In Turbo C you can use gotoxy(), and for the highlighting you'd probably use textcolor(). Read the documentation for further details about those two functions. [URL="http://www.urbandictionary.com/define.php?term=inb4"]inb4[/URL] don't use Turbo C. | |
Re: > yes daniweb is not user friendly and it should allow its users to delete their thread Yeah, allowing members to arbitrarily destroy the continuity of the forum and alter *other* members' posts on a whim is such a fantastic idea... :rolleyes: You sound very selfish, dude. By the way, … | |
Re: > I dont even know where to start since I am struggeling with the whole pseudocode process. Pseudocode is nothing more than a structured way to organize your algorithm's steps. For example, the following is a valid (but largely useless as it stands) pseudocode program: Open the east file Sort … | |
Re: > strcmp will not do good, u have to use strstr() If you want to count exact full lines then strcmp() is better. If you want to count lines containing a substring then strstr() is better. The two accomplish different goals. | |
Re: You're vastly overcomplicating trivial stuff and ignoring important stuff. Compare and contrast your code with this: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 3 #define LEN 100 char **func(void) { char **ptr = malloc(MAX * sizeof *ptr); /* Always check malloc for failure */ if (ptr) { size_t i; … | |
Re: For communicating with a server, I'd probably start with a web service. The server exposes a WSDL which the not-keylogger connects to and calls methods on. The only issue with that in my experience is the relatively hard coded nature of web service references in the client. If the WSDL … | |
Re: 10 in binary or 10 in decimal? In binary 10 is 2, which gives you the [ASCII value](http://www.asciitable.com/) for the control character STX. Really all you need to do is get the integer value and then treat it like a character. To be strictly correct with 7-bit ASCII, make sure … | |
Re: Well, the specific syntax you posted is a [GCC extension](http://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html). but C99 *does* support variadic macros with more or less the same syntax as variadic functions. The big difference is how the argument list is retrieved (`__VA_ARGS__` for C99 and `args` for GNU). | |
Re: The concept is sound, but super inefficient due to the overhead of chasing pointers. | |
Re: Technically it's not a constraint violation so the compiler isn't required to produce a diagnostic message. At best you'd get a warning for a persnickety compiler. For example, Comeau gives me a warning under default settings, but Pelles C doesn't except for the highest warning level. Visual C++ 2010 doesn't … | |
Re: I'm not sure I understand the question. You can reset your password from the login popup, and the only way that wouldn't work is if you no longer have access to the email address assigned to the account. Nevermind, I see what happened now. As the warnings clearly state when … | |
Re: This is an excercise for you to learn. Being given the code only teaches you to beg for freebies. It's not a difficult exercise, please make an honest attempt and then if you have problems feel free to ask about them. | |
Re: Dude, go read a book on C. You're asking for something so trivial that I can't imagine anything other than total ignorance as the cause. This forum is not for holding your hand and teaching you from scratch. | |
Re: The the result were the same, why would we have both %d and %c specifiers? If you use %d then the value of ch is interpreted as an integer and the value 23 is displayed. If you use %c then the value of ch is interpreted as a character and … | |
Re: Are you asking what we snack on while coding, or what we eat in general? What I eat in general is mostly a healthy diet of whole foods. Staples include: * Tea * Coffee * Oatmeal * Peanut butter * Cheese * Chicken * Veggie burgers * Frozen Fruit * … | |
Re: You're correct, in a manner of speaking. The problem is that you haven't told the recursive chain higher up that the desired leaf was deleted. What happens if by deleting a leaf, you've created a new leaf? And what happens if that occurs all the way up to and including … | |
Re: I thihnk a B.S. in computer science would look better on a resume than information technology. | |
Re: I don't understand the requirement. `n` already has the number of items, so to get the last index all that's necessary is to subtract 1 from `n`. Theres no need for a pointer that I can see. | |
Re: > I think we just need to convey our message. Poor spelling can obscure the message. > here, many people are there who are not so good in english and don't spell correctly. Actually, I've found poor grammar to be more obtrusive than all but the most grievous of spelling … | |
Re: This is actually an amusing exercise, but if you can really *only* use one loop then you'll need to employ a trick of two that technically involves an implicit loop. Since you're essentially working with a 2D grid (ie. rows and columns) at least two loops are necessary to get … | |
Re: You try to print `size` from a static member function, but `size` isn't a static member. To access non-static members, you need an object, because that's where memory for non-static members is allocated. | |
Re: Both would be suitable. King's book is more highly regarded by experienced programmers, but having read both, I think as an absolute beginner you may prefer Prata's book. | |
Re: Put simply, the point is to enforce a trailing semicolon on calls to the macro without losing the massive benefits of having the macro wrapped in its own scope. | |
Re: > And why would you rely on a simple C function in a managed language? Because this thread was originally posted in the C forum and gerard probably didn't notice that the code was C#. | |
Re: For the decimal digits you can subtract '0' to get the numeric equivalent: '0' - '0' = 0 '1' - '0' = 1 '2' - '0' = 2 '3' - '0' = 3 '4' - '0' = 4 '5' - '0' = 5 '6' - '0' = 6 '7' - … | |
Re: This is homework. What was *your* answer to the question? It has to do with how signed and unsigned types interact. | |
Re: Have you tried searching the forum? We regularly get people trying to install a Model T engine (Turbo C) in their 2012 Ferrari (modern Windows OS). | |
Re: > But here i have defined MAX one time only and it will get substitued by 5 before compilation begins.So which one is better? Neither. If you're comparing a constant with a constant then you should just strip away the test entirely because it's not dependent on runtime values, or … | |
Re: Do you know anything about [hash tables](http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_hashtable.aspx)? That's the first step, as a hashmap as it's usually seen is really just a pretty interface over a hash table. | |
Re: If you know what the storage classes are and what they mean then it's fairly obvious that they're nonsensical when applied to function parameters. What semantics where you expecting? |
The End.