3,183 Posted Topics
Re: > I think this is caused by removing the new posts, but, if this is so, isn't it possible to also update the 'last posted' date (if that's how it's stored) so that it won't come up any longer as one of the last updated threads? It's possible, but not … | |
Re: Yes, there's certainly a way. What OS are you targeting? | |
![]() | Re: If none of the sub forums are quite right for your question, you can post to the category (ie. Databases) and tag the thread accordingly. ![]() |
Re: [This](http://eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx) may help. You can find details about dynamic memory for arrays near the bottom, but the rest is useful information about pointers too. :) | |
![]() | |
Re: Semicolon. And you've been asked before to state what the error is. If you continue to post vague requests for help, I'll stop trying to help you. | |
Re: > I am wondering if there is a way to include subscripts or superscripts in Daniweb? Not presently. When we were using vBulletin as the back end we allowed TeX formatting, but it was very much unused. > I tried to use HTML code (<sub> and <sup>), but that didn't … | |
Re: > Freeing a NULL pointer will cause the program to crash. That's incorrect. Calling free() on a null pointer is guaranteed to be a no-op. | |
Re: I think the errors can be summarized thusly: **an array is not a pointer** and **a string literal may not be modified**. | |
Re: If you can't think of a program with all of those constructs, maybe you shouldn't be using them all at once yet? ;) | |
Re: Undefined reference means you've declared a name but not provided a definition anywhere. This usually happens when using a library's header without linking to the library. | |
Re: "Better" is a meaningless word without any context. Are you asking this question out of general curiosity or because you want to use one of those frameworks for your next project? If it's the latter, what are the needs of the project? If it's the former then I can only … | |
Re: > So my question is why virtual functions are needed if same task can be achieved by scope resolution operator? I'll answer your question with another question: If you're given nothing but a pointer to the base, how do you know which type to use for the scope resolution operator? | |
![]() | Re: If the length of your list is large enough that a faster sort is warranted, then a linked list is the wrong choice of data structure. But I'll mention two things: 1. Bubble sort is a bitch with linked lists. [Insertion sort](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#insert) is *much* easier to implement. 2. Following that … ![]() |
Re: What do you know about [binary coded decimal](http://en.wikipedia.org/wiki/Binary-coded_decimal) representation? That appears to be what the function's intended purpose is, which is a bigger issue than the type of `pBcdBin`. But the type of `pBcdBin` is a pointer to zero or more bytes (that's what uin8_t represents here), where neother the … | |
Re: > Because I couldn't install netbeans at home so I couldn't try. So NetBeans is the only C++ implementation? I see you tried sooo hard. :P | |
Re: > This is obsolete and its use is frowned upon. So are TSRs. If you're not into obsolete stuff, learn to write a Windows service (assuming Windows as the natural progression because you're talking about DOS). | |
Re: The problem is that indexings() takes its parameters by reference rather than by value or const reference. Unfortunately, there's not really a fix for that unless you remove the updating of `totals` and put it somewhere else. For example: for (vector<Student_info>::size_type i = 0; i < students.size(); ++i) students[i].totals = … | |
Re: > What is the value of EOF in c...? The value of the macro EOF is completely irrelevant because it's an internal standard library flag that has no meaning to either you or the outside world. Though nitin1 is correct that it's usually defined as something like -1. ![]() | |
Re: > can anyone tell me whether we can use const variables for case ... No, case labels must be a compile time constant. In C the `const` keyword doesn't make the variable truly constant, it just makes it read-only under normal circumstances. Turbo C might offer a extention to support … | |
![]() | Re: > I would say that, particularly in portable code, the C bitfield syntax is of no use. Only if you're using it to map an object or performing I/O with it. Bitfields are especially useful for flags, and in that case they're generally simpler to work with "out of the … |
Re: Whitespace and curly braces are used to determine whether or not you're likely to be posting code. After "Dear XYZ", you type a bunch of spaces on the next line as if you're composing a letter, which due to the indentation is error checked as code. Any code block must … | |
Re: There's no good answer to this question without a significant amount of context. | |
Re: > scanf("%d",n); Apparently you still don't understand how scanf() works. Allow me to elaborate a bit. Every argument in C is passed by value, which means that a copy of the value of an argument is made and assigned to a temporary variable represented by the corresponding function parameter. So … | |
Re: Does it still show as 1 when you empty both your outbox and inbox? That should reset the count as well as remove any orphaned messages. | |
Re: As far as goes, it's unnecessary to micromanage like that. However, I think that given the awkwardness of using iterators here, subscripting is cleaner anyway. Just make sure to check boundaries of *both* vectors. | |
![]() | Re: `b=0` isn't the only difference, you also added the `for` keyword and an argument list to the macro which assigns i to b and 15 to c instead of expecting b and c to already exist as variables. It's actually a miracle that the original code compiles at all (I … ![]() |
Re: > Thank you for at least replying! But, I must say to reply to something without reading is like learning to program without a purpose. Think positive!<3 I carefully read your first post this morning but didn't reply. Does that count? ;) | |
Re: > What is the reason behind it... If you lie to printf(), you get what you deserve. When you tell printf() to expect an int, it treats whatever you pass like an int. When you tell printf() to expect a float, it treats whatever you pass like a float. If … | |
Re: > no iam asking about sorting now Maybe you should finish learning something before running off to learn something new, because you keep making the same mistakes. | |
Re: > One last thing,do we need to learn any other subjects to develop a software other than just the programming language..?? Yes, you need to learn general programming theory and problem solving. The rules of the language are easy to learn, putting them together into a functional, robust, and useful … | |
Re: strcpy() uses '\0' as the stopping character while memcpy() requires you to specify how many bytes are being copied. memcpy() isn't guaranteed to be safe if the source and destination blocks overlap while memmove() does have that guarantee at the cost of performance. Due to the types involved, the mem\* … | |
Re: > My question is when does this function works improperly and why? Technically it works improperly when you call it with an input stream or an update stream in input mode. That is, if you use fopen() with a "w" mode, or a "+" mode and you're currently in the … | |
Re: > the compiler say the error is at here at 18th line if(ch== '') There's no such thing as an empty character literal, the compiler is telling you that. I can only speculate about what you were trying to do, which is check for the end of a string? In … | |
Re: If you're not using Turbo C, you can't use graphics.h. If you're new to game programming I'd recommend writing a few text-based games first, then look for a more modern graphics library. [SDL](http://www.libsdl.org/) and [Allegro](http://alleg.sourceforge.net/) are two names that pop up regularly for starting out. ![]() | |
Re: Try opening windows.h and reading the declarations. Then for each declaration, do a search on MSDN. And here's a tip: MSDN's search facility is an embarrassment of epic proportions, so if you need to do anything but an exact match search, use Google with the `site:` filter. | |
Re: Are you sure you're *not* a bad programmer? Because your logic is atrocious. ;) | |
Re: > is it possible to write our own display statement and input statement Certainly. How do you think the stuff from stdio.h was written? One cool thing about the standard C library is pretty much all of it can be written directly in C. I've actually implemented the standard C … | |
Re: If you don't bother to read my replies then I'm going to stop trying to help you. How do I know you aren't reading my replies? Because if you were, then you'd realise that I already answered this one with [another post on a similar topic](http://www.daniweb.com/software-development/c/threads/429137/replacing-a-string-in-string#post1837477). | |
Re: It's not as simple as that, but if you're only using getline() then there should be no need to ignore garbage *if* you're using getline() correctly. The problem of garbage nearly always stems from reading partial lines or mixing getline with formatted input (in the form of the >> operator). … | |
Re: I think all of your problems stem from re-opening the file in your functions. Opening a file stream in write mode will truncate the file to zero length, so every time you call print(), the data in the file gets wiped out. One way to fix it without significant changes … | |
Re: > int u[]={} You need to give your array a size. I'm surprised there wasn't an error from this definition. | |
Re: > It's not quite the same. Meaning what, exactly? Are you doing a conversion but not sure your conversion is accurate? Are you getting errors when running it? Unexpected behavior? What's not right that you want fixed? | |
Re: [This](http://www.torek.net/torek/c/pa.html) may help. It's written by Chris Torek, who's a man deserving of great respect due to his deep knowledge of C. | |
Re: The algorithm is correct, though two things stand out: 1. You don't account for a number that's less than 1. In real code this can cause problems. 2. The loop stops when counter is equal to 1, but due to the way the factorial and counter interact, you could stop … | |
Re: I don't particularly like how you're trying to lump everything together because it complicates an already complicated algorithm. There are three separate parts to replacing a substring: 1. Find a matching substring. 2. Make room for the replacement. 3. Insert the replacement. Separating the tasks conceptually will help you write … | |
Re: > how to solve Start by trying *something* on your own or asking a specific question. We're not here as a free homework writing service. |
The End.