3,183 Posted Topics
Re: That totals to 5,978,160 bytes (assuming 8-byte `double`). Not horrible, but something to think about, especially if you can devise a way to avoid keeping all of those values in memory if you don't really need them. Now to answer your question: 1. Yes. 2. God yes. Doing this manually … | |
Re: > Makes a change from when it was all the C/C++ people :) I'm curious to see what kind of attitude shift will result from this. The C/C++ folks can be a nasty and unrelenting bunch (*\*cough\**Narue*\*cough\**). ;) | |
Re: I work for a consulting firm rather than freelance, but technically the work is still contract. So.... 1. We charge the same base hourly rate across the board, with business and after hours charges for support. 2. Work is work. As long as you can show a steady stream of … | |
Re: Rather than list out everything I did, I'll just post the code: #include <stdio.h> #include <stdlib.h> typedef struct tree { int data; struct tree *right, *left; } TREE; TREE *insert(TREE *, int); TREE *findmax(TREE *); void order(TREE *); void structure(TREE *root, int depth); int main() { TREE *root = NULL; … | |
Re: Reading a delimited file can be super easy or somewhat tricky depending on the format. If you're doing something super basic where the delimiter isn't allowed to be embedded in field data, it's almost trivial: #include <fstream> #include <iostream> #include <iterator> #include <sstream> #include <string> #include <vector> namespace file_management { … | |
Re: Tested, confirmed, fixed, and pushed to staging. It should make it to production today or tomorrow. Thanks for the report. :) | |
Re: But note that T** is *not* a compatible type with T[M][N], so a function expecting the former will not accept an object of the latter. | |
Re: > The problem I have with the funcion, is that I am unable to read the "Float" and "Double" type parameters Varargs are always promoted, so there's no such thing as a `float` type parameter. That's your biggest problem: instead of trying to extract an object of type `float`, you … | |
Re: I'm not sure the backslash is an "official" solution. Unfortunately I'm not in a place where I can peruse the code at the moment, but I don't recall any provisions in the parser for such a thing, so it may simply be an unintended feature that could potentially go away … | |
Re: > Well.. m sorry to go against what u just said zeroliken, but it isnt undefined... Its how the prefix and postfix operators work.. Nope, it's definitely undefined because i is modified more than once between sequence points. The commas in a function call don't count as sequence points. > … | |
Re: You're getting that error because pointers aren't magic. If you want a pointer to point to N bytes of memory, you *must* ensure yourself that the memory exists and assign the base address of that memory to the pointer. The specific problem here is that you're using uninitialized pointers as … | |
Re: And now for the obligatory question: why do you think you need to clear the screen? There are only a handful of reasons where it makes sense outside of a GUI environment, and quite a few reasons why it's a bad idea in a textual environment (the kind of environment … | |
Re: > Being human that I am (I really, really am!) and having preferences and being overly-opinionated in every possible field, my answer to "What kind of device is IPad?" was "Crappy". Not that I find it crappy, I just generaly dislike mass-produced consumer items, but that doesn't matter.. what matters … | |
Re: Posts are retained forever unless they break the rules and are subsequently deleted. As for how long it takes to get a response, it very much depends on the nature of the question and the forum. Some forums are very active while others are less so. If you don't get … | |
Re: Not that we can tell. The over 200 with a huge portion being spambots was before migrating to the new system. | |
Re: Are these watched thread notifications or recommended thread notifications? | |
Re: There are many here who can help you when you ask a specific question, but nobody will do your project for you. | |
Re: void* p; // Create a pointer to void functionName(&p); // Pass its address to create a void** Note that a `void**` isn't generic like `void*`, so you can't pass the address of a `char*` or `int*` when `void**` is expected. | |
Re: [QUOTE]This is C++? Not on any planet I am familiar with, and I have only been programming C++ for 20 years, professionally![/QUOTE] [URL="http://en.wikipedia.org/wiki/C%2B%2B/CLI"]C++/CLI[/URL], it's C++ extended to meet CLI requirements and fit into the .NET framework as a managed language. | |
Re: Cool story, bro. Am I correct in inferring that you don't want that to happen? Because you neglected to ask any kind of question. | |
Re: The initialization is fine; the problem is a typo in your printf() calls. The closing paren is misplaced. Try this instead: printf("%d\n", p[0].var1); printf("%d\n", p[0].var2); printf("%d\n", p[0].var3); printf("%d\n", p[0].var4[0]); printf("%d\n", p[0].var5); printf("%d\n", p[0].var6); | |
Re: What kind of help do you want? Simply posting an assignment verbatim without any evidence of thought or effort on your part is against Daniweb's rules. But I'll give you the benefit of the doubt and kindly request that you ask a specific question and prove that you've made some … | |
Re: After watching the first episode, Acchi Kocchi looks promising. I was kind of annoyed when Danshi Koukousei no Nichijou ended, so woot! | |
Re: > All errors are resolved and it runs, but as soon as it starts it says "main.exe has stopped working" and closes. That's what I'd call "doesn't run", given that it crashes immediately upon loading. What you want to do is run your program in a debugger so that execution … | |
Re: > In C, you must know what you are doing. Yes indeed. > fflush(stdin) // OR fpurge(stdin) on unix-like OS Oh, the irony. fflush() is specifically designed for output streams, and if you know what you're doing then you've probably heard that the C standard says calling fflush() on an … | |
Re: So far everyone has been assuming you want 3 of 9 barcodes, which isn't necessarily a safe assumption. If 3 or 9 or another simple linear barcode symbology is acceptable then it can be as easy as adam_k suggested: barcode readers are usually USB and send translated results directly through … | |
Re: Article is a more generic term for the same things you're familiar with. Threads are articles, news stories are articles, white papers are articles, code snippets are articles, etc... Articles may also contain replies, which are post; this makes sense because Daniweb is a discussion community. ;) > and when … | |
Re: volscolts16 hasn't visited Daniweb for 2 years. You're not likely to get any answer in this thread. | |
Re: I'm not sure I understand the requirements and they're not obvious from the code given. What should this calculator be doing? | |
Re: Could you be any more vague? The thing is I made a bet with a coworker that "I have to scan a file for things" isn't the worst possible question one could ask if one is expecting any kind of useful answer. | |
Re: Since the OP found the problem but didn't explain what happened for readers of this thread, allow me: int total[SIZE]; printf("%d",total); The %d specifier expects an integer value, yet an unadorned `total` is equivalent to `&total[0]`. Thus the argument tied to %d is a pointer to int rather than an … | |
Re: The default back-end for std::queue is std::deque, which grows and shrinks dynamically. std::queue is actually a form of adapter that sits on top of a data structure to provide a convenient interface. std::stack is the same way. std::deque is implemented in a somewhat confusing way, so you might consider studying … | |
Re: C++ doesn't do graphical elements. You'll need to use a GUI library of some sort, though upgrading to a compiler that wasn't designed for MS-DOS would greatly facilitate your search for a working library.. | |
Re:  | |
Re: It's not much different from declaring a function at file scope: void some_function(); std::thread f() { return std::thread(some_function); } The difference between this and your example is the visibility of `some_function` in the file. When the declaration is at file scope, everything after the declaration in the file can see … | |
Re: Um, triumphost...fscanf() is for input, cout is for *output*. You probably mean cin: std::cin >> student[x].name >> std::ws >> student[x].num; Unfortunately, cin doesn't try to match literal data, but literal whitespace in the *scanf() format string is a special case. It means "extract and ignore any amount or type of … | |
Re: Exhibit A: `CRobot** donut_population;` Exhibit B: `init_population(donut_population, pop_alpha, pop_beta)` Exhibit C: `void init_population(int** donut_population` The `donut_population` you pass is `CRobot**`, but init_population() expects `int**`. | |
Re: Does the following not work? returnSeq.seqType = RNA; /* Initializing to RNA, for example */ | |
Re: I don't see the benefit here, especially given the hoops you'd have to jump through to achieve the desired syntax. Is it possible? Yes. Is it worth it? Only if you can come up with a justification that amounts to more than saving two keystrokes (the angle brackets in this … | |
Re: Go ahead and click the button to add reputation, the difference between rep and a mere vote is the presence of a comment. In other words, if you leave the comment blank, it's just a vote even if it comes from the "Vote & Comment" button. And we'll look into … | |
Re: I'm assuming you're reading the entire input into a single string. You'll need to first break this string up into individual "words", or items separated by whitespace. Then each word will need to be converted to an integer and assigned to the array. For example: #include <iostream> #include <iterator> #include … | |
Re: > i think the even bigger concern , is the ammount of useful and helpful posts that receive no voting at all, with or without rep. > > some of these people are just plain ungrateful :( Providing answers and help is a thankless job, to be sure. But that … | |
Re: You can tell by the number of replies, the most recent respondant name, and if thread subscriptions are turned on, you'll be notified by email as well. Unfortunately the recent activity icon isn't working quite as we'd like, but that's on the list of things to fix, so it's only … | |
Re: You need to build the integer value manually using its component bytes: #include <iostream> #include <Windows.h> using namespace std; int main() { BYTE freeBlocks[4] = {0x00, 0x05, 0x7d, 0xa4}; DWORD displayValue = 0; displayValue = freeBlocks[3]; displayValue |= freeBlocks[2] << 8; displayValue |= freeBlocks[1] << 16; displayValue |= freeBlocks[0] << … | |
Re: The accepted way to terminate your account is to remove any personal information from your edit profile page, log out, and never log back in under that name. Naturally this doesn't actually remove the account (which we retain for anti-spam law conformance) or any of your posts (which we retain … | |
Re: Those errors coming from the use of a library suggest that you aren't properly linking to it. Did you make sure to link to the .lib/.dll file for OpenGL, or just include headers? | |
Re: > Why would one be permanently linked to a website? Because we send bulk emails and need to prove that everyone we've sent an email to has opted into it by registering. It's equally effective to remove all personal information from your profile (some of which, such as changing your … |
The End.