3,183 Posted Topics
Re: > Will there be any rating score of a thread (quality of the topic in the thread) in the future? Possibly. :) Technically it's no big thing to add thread ratings, but I'm on the fence as to whether it should be calculated from thread statistics or more of a … ![]() | |
Re: Adding to what sepp2k said, when you say `Text foo`, it's as if you said `char foo[80]`. A typedef represents a type, where the name of the typedef fits in the same place that the variable name would in an actual declaration. It's simpler and more consistent to keep the … | |
Re: The problem seems to have solved itself, but the answer is largely no. There are two ways to reverse a vote/rep: 1. The voter must do it from their account by navigating to the post and clicking the vote button a second time. 2. We go into the database, delete … | |
Re: Note that I'm adding to happygeek's answers and directing them at geniusvishal. > No, it is not possible. Even administrators (such as myself) cannot see who is downvoting. The system is designed to be anonymous. It's possible, given that we *do* store that information in the database. But there's no … | |
Re: Are you trying to store the music file itself as a blob, or are you storing a path for the file and relevant metadata? Because the former isn't recommended and the latter is trivial as long as you have a way of extracting the metadata. | |
Re: > Are our speeds extremely slow? Yes. But that doesn't mean your *capacity* is low, it just means that at the time you ran the speed test, the pipe was bogged down. I'm guessing you didn't run the test when your machine was the only one active on the net. … | |
Re: Your code doesn't have any continue logic. Could you post the code that "fails every time" so that we can help you fix it? | |
Re: Rather than treat each line as separate and independent, collect them in a record where you can validate each field as it relates to the others. So for line 8 you'd be looking for a name, correct? Digits are a clear case of error when looking for a name, so … | |
Re: Do you know how to find the solution in a graph manually? If not, that's where you start. Understanding both the problem and how to reach a solution to the problem is paramount. You can't write code to do something you don't know how to do. | |
Re: We require proof of effort when helping with homework questions. What have you done so far? Do you know how to calculate the average of N numbers manually? Do you know how to create and populate an array? | |
Re: > is it necessary to add it all the time? Yes, because that's the definition of a string. Just because something seems to work at the moment you test it doesn't mean it's correct or guaranteed to work all the time. C is one of those languages that won't help … | |
Re: I think I'll ask why anyway. Are you trying to reverse engineer an algorithm or something? | |
![]() | Re: > I have to build a programme Yes, **you** have to build it. What have you tried so far? What has your research into solving the problem shown you so far? Have you done *anything*? |
Re: > what is the difference b/t PHP and ASP.net In what context? There's a world of difference even though they can both solve a similar problem (ie. server side scripting). Your question is like asking what the difference is between a Mac and a PC, it's a very broad topic. | |
Re: > I never defined str size, yet it works It crashes miserably and consistently for me. I guess "works" is a pretty loosely defined term. ;) | |
Re: > I'm not sure exactly how that should be achieved, but I imagine at least the age of a post should grow larger and bolder as the post grows older. I like that idea. Perhaps make it stand out by using a bold font and red color after our age … | |
Re: > When the user bypasses entering anything within those textboxes (as they should do), what is the correct way to handle the reporting? If null values are acceptable in the database then you can write DBNull.Value when the string is empty. > Is there a way to determine if the … | |
Re: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.validating.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.control.validated.aspx | |
Re: > says that there are many errors. :( Like a lot of the PHP I've seen. That book must be really popular. :D ![]() | |
Re: > Thats another way to read file content. Assuming that the body of the loop properly checks for and breaks on end of file, sure. However, this loop will likely print the last line of the file twice: while (inFile.good()) { getline(inFile, line); cout << line << '\n'; } The … | |
Re: > I wonder is it safe? As written it won't compile, so if you want to get technical it's perfectly safe as it'll never run. However, I suspect that you're paraphrasing. If definitions of those arrays are provided somewhere else then the code will compile and run. Assuming a more … | |
Re: > Look I'm not saying anything bad? You're not saying anything *bad*, you're just completely wrong. I suspect that the errors you're getting are due to how you're copying and compiling the code, not anything with the code itself, which is just a snippet and contains exactly one error on … | |
Re: > Enter key is stored in the buffer of getchar as '\n' or '\r'?? '\n', always. Even if the underlying representation for the system is different (such as CRLF on Windows), getchar() will convert a newline to '\n' for you. That works for output too, so '\n' will become the … | |
Re: > row[2] and row[3] are already doubles In a DataRow, they're objects. They may *actually* be doubles, but the immediate representation is Object as stated by the documentation for the [index operator](http://msdn.microsoft.com/en-us/library/kwfe1t7z.aspx), so you must do a conversion. Your solution is funky because double.Parse() requires a string argument. You can … | |
Re: You could certainly write a background service that ticks seconds and runs at startup, but pretty much every modern OS will provide a way to query uptime. What OS are you targeting? | |
I was going to post this in a thread, but it turned into something a bit more serious and may be useful as a code snippet. The code shows three files: * menu.h: The header file for the menu library. * menu.c: Implementation of the menu library functions. * main.c: … | |
Re: Switch cases only work for integral values. Ideally you'd somehow check the string and convert it to a number, or just compare directly. For example: #include <cctype> #include <iostream> #include <string> using namespace std; int type_index(string type) { // Normalize the string to a consistent case for (auto& ch : … | |
Re: > While one says "definition occures once through the program( memory is allocated once ), but the declaration can occur many times.", the other says "This means that the declaration is only one throughout the program but definitions can be many." The first one is sufficiently accurate and the second … | |
Re: [[16.21] How can I force objects of my class to always be created via new rather than as locals or global/static objects?](http://www.parashift.com/c++-faq/static-create-methods.html) | |
Re: > The word 'cout'stands for console output. It stands for "character", as stated by a [somewhat authoritative souce](http://www.stroustrup.com/bs_faq2.html#cout). That's fortunate too, because if `cout` were named after and designed for consoles and screen display only, it would be vastly inferior to the general stream we enjoy today. | |
Re: Serializing objects like that is not safe unless you can guarantee that the class in question is a POD type. In the best case for something like std::string, you'd end up writing addresses pointing to data rather than the data itself. The actual data would be lost and the addresses … | |
Re: > @ tinstaafl it is also working fine on my dev-c++ but why it giving RTE on ideone? I suspect you're not giving the Ideone sufficient input to work with. Click the "upload with new input" button and add this: 5 1 2 3 4 5 There should be no … | |
Re: Sorry dude, but I think a good lesson for you right now would be to *fail miserably* because you relied too much on the kindness of others in doing your work for you. | |
Re: Do you seriously work with your code unindented like that? So far all of your posts have zero indentation before some kind mod fixes it. | |
Re: I plan to go to work every weekday, just like the rest of the year. Slightly improved traffic will be a nice change though. | |
Re: [This](http://developer.gimp.org/writing-a-plug-in/1/index.html) looks promising. | |
Re: > An array of pointers is possible beacuse pointers are similiar to variables. Pointers *are* variables, and the values they hold are addresses. > \*pt[3] is an array of 3 pointers i.e 3 locations are set aside for the storage of the addresses of 3 variables. In the context of … | |
Re: > @sepp2k Then why does the code give no error if I remove static and write simply int a; a=5; Because the default linkage at file scope is `extern`. This: int a; int main(void) { a = 5; return 0; } Is functionally identical to this: extern int a; int … | |
Re: I prefer the iOS experience. Android has responsiveness issues whenever I use it, and that slight delay seriously affects the experience. Responsiveness issues seem few and far between on iOS. | |
Re: > On the endorsements, i noticed that i have several endorsements on C# and Java and i was wondering if they should show up in the "Favorite Places to Post" section? They show up on the main view of the forum or category where you've been endorsed. So at present … | |
Re: > Need help "Help" suggests that you're doing most of the work and others are providing assistance when you get stuck. However, posting nothing but a homework assignment suggests that your definition of "help" is closer to "do it for me". So please provide evidence that you've put in some … | |
Re: Line 11 of your program doesn't call the function, and as a result the compiler assumes you want that function's address. You need to include the argument list to call it: printf("%d %d\n", n, powerof2(n)); | |
Re: It looks like you're mixing standard C and Objective-C. Note that this is the C forum, did you mean to post in the Objective-C forum? | |
Re: strcmp() doesn't return a boolean, it returns a relation: * <0 - The first string is lexicographically "smaller". * 0 - The two strings are equivalent. * \>0 The first string is lexicographically "larger". So when you want to test for equality, it should look like this: if (strcmp(a, b) … | |
Re: That header is pretty much specific to Turbo C, and it's also ancient in terms of graphical feature support. I'd strongly recommend using something more up to date, like Qt or OpenGL. What do you want to use graphics for? | |
Re: I'm not so stereotypical as to conform to a label. ;) | |
Re: > I am receiving such annoying PM from mvmalderen. I'd suggest ignoring them if they annoy you so much. If you get PMs that are abusing or harrassing, feel free to report them. > This must be either through Post in feedback not through PM. There's no such requirement. I … | |
Re: > can't we use a string function pls? Um...what? | |
Re: If the voter were interested in explaining his or her reasoning, they would leave a comment rather than just vote, or reply to the thread in addition to voting. I'm not sure I see the benefit of showing who down votes, given the potential for revenge voting. |
The End.