6,741 Posted Topics
Re: >But the author doesn't make this clear so I'm not sure. Your analysis looks good to me. >Then surely (memory[0xFFFD] << 8) will simple equal 00000000? Integral promotions are performed on both of the operands to the << operator, so that snippet would only be shifting away the relevant bits … | |
| |
Re: >Here's the doubt. You don't have a doubt, you have a question. To have a doubt means that you understand something, and subsequently disagree with it. A question, on the other hand, suggests incomplete understanding and a need or request for clarification. In some cases question can be used in … | |
Re: >I do not know how to start the program!! I always start with this: [code=cplusplus] #include <iostream> int main() { } [/code] >When it says "exponentially" then what formula should I use for the output? The description says to double approximately every 24 months. Using that as the baseline, you … | |
Re: >in the underlined part, by greater value does it mean that A has greater value than B? strcmp compares each character in order and returns the result of the first two characters that don't match. It's equivalent to this implementation: [code=c] int jcmp ( const char *a, const char *b … | |
| |
Re: >Can anyone tell me if this video and course work is helpful at all? In my experience, video courses on programming are all crap. | |
Re: Build it manually: [code=cplusplus] #include <iostream> #include <string> int main ( int argc, char *argv[] ) { std::string args; for ( int i = 0; i < argc; i++ ) { args += argv[i]; if ( i != argc - 1 ) args += ' '; } std::cout<< args <<'\n'; … | |
Re: >#define p printf This is an extremely bad idea. If your teacher taught it to you, slap him for me. >clrscr(); This is a bad idea. Not only is it anti-social (by removing the output of other programs when run in a shared console), it unnecessarily destroys the portability of … | |
Re: Post the code you've completed. We don't care how much you beg, no proof of effort results in no help. | |
Re: >Firstly, am I right? So far, yes. >I get Segmentation Fault. Did you allocate memory to the individual pointer or just the array? There are two steps here, first you allocate memory for the pointers in the dynamic array, then you allocate memory to each pointer to hold a node … | |
Re: You have three distinct problems. 1) You need to use square brackets instead of parentheses when dynamically allocating memory: [code=cplusplus] // Square brackets! name = new char[strlen ( foo ) + 1]; [/code] 2) You need to use the syntax for delete that matches the syntax for new: [code=cplusplus] base::~base() … | |
Re: You only perform the copying steps if the search string is found. Add a "not found" case where the line is copied as-is if the search string isn't located. | |
Re: In other words, part of the file is ASCII and the rest is binary data. >Can I do the above (ie. read with getline() and then read binary? Sure, but you may encounter problems with newline conversion. >How would I read 12 bits at a time (for a 12-bit color … | |
Re: That's a good start, but you aren't taking into account the rest of the data on the line. What you need to do is a string replacement, which involves copying everything before the search string to a buffer, append the replacement string, then everything after the search string. Depending on … ![]() | |
Re: >I need to store all messages during the chat sessions among users. Is this some ad hoc chat program that doesn't support logging? | |
Re: >Still doesn't recognize MessageBox() though.. I thought it didn't require any header files? You thought wrong. You need to make sure that windows.h is included and that you're linking to either user32.lib or user32.dll. | |
Re: >i was wondering how much i should use classes in C++. As often as you need them, obviously. In my experience, this question is born of ignorance. You don't understand OOP and classes well enough to know when to use them, so you try to turn it into some kind … | |
Re: >Do anyone know if a someones privacy rights have been infringed if a >signed document has been scanned and uploaded onto a website at all? I'd say if a signature was required on the document, it falls under the category of potentially sensitive. >what would be a good way to … | |
Re: >Now it somehow skips straight to 'else', missing out the 'if' and the 'else if'...... That's because getch doesn't perform text conversions. It's a straight detection of scan codes from the console. This means that on systems (such as Windows) where a newline is two values before being converted to … | |
Re: I'm not sure what you mean, but I'd guess that you don't know how to signal end-of-file from the command line, so the loop never ends. Hold down the ctrl key and press z (ctrl+z) if you're on Windows and d (ctrl+d) if you're on Unix or Linux. | |
Re: Here's something to play with as a template: [code=cplusplus] #include <ios> #include <iostream> #include <limits> #include <string> using namespace std; int main() { bool done = false; do { int value; cout<<"Enter a number: "; if ( !( cin>> value ) ) break; cout<<"You entered "<< value <<'\n'; // Clean … | |
Re: >I'm trying to prove to my teacher that Div and Mod isn't always the best way to solve things. I find it humorous that you seem to think "fastest" and "best" are synonymous. >You're all welcome to show your instructors this =) Oh, I will indeed. It's a very amusing … | |
Re: >can any one make me a computer operating system Sure, [URL="http://www.linux.org/"]go here[/URL] and help yourself. | |
Re: Do you actually want to convert to little endian or is this some kind of homework project? Because converting to hexadecimal doesn't enter into the picture if you're working with the bytes. The representation only matters for display and such. | |
Re: The problem is a faulty flux capacitor on line 42. | |
![]() | Re: >How would I generate a csv file The first thing that comes to mind is a sparse matrix to store the coordinates and value. Then when you iterate through the matrix, you can fill the gaps with empty fields and blank lines as appropriate, and really all you need to … ![]() |
Re: You know what [B]I[/B] need urgently? Hope for the future in the form of a beginner who actually does his or her own homework without begging for freebies. I actually don't mind giving freebies to people like that because they use the code wisely and for everyone's benefit. | |
Re: >Could you please explain to me how to write the >user defined functions with multiple arguments? There are three patterns for function parameters. First is a function with no parameters: [code=cplusplus] void foo(); [/code] No parameters is described in code using parentheses where there's nothing between them. Next is a … | |
Re: Weak or unpolished graphics can distract from the gameplay in many cases. Likewise, attention to detail in the graphics can improve gameplay by drawing the player in and offering more variety in how elements are displayed. Compare shooting at red blobs with a frowny face to shooting at a noticeably … | |
Re: >The due date is tomorrow And you were given the assignment today, I'm sure. :icon_rolleyes: You seem like yet another boob who screwed around when he should have been working and expects us to provide a free lunch. You want help? Show us your code. If it looks like you've … | |
Re: How to do your own work before it becomes urgent? Well, clearly you don't know the answer to that one. :icon_rolleyes: | |
Re: >I am wondering what extra expertise is needed to apply for Job postings >which says 'Exp in Banking' or 'Exp in Financial industry is a must' ? Basically, you're expected to have worked in that industry before. You'll be asked to do things that require knowledge of the concepts, terminology, … | |
Re: >#include <iomanip> // what is this library used for The <iomanip> header essentially declares stream manipulators that take an argument. This is as opposed to those stream manipulators that don't take a special argument and are declared in the <ios> header. The code you posted is actually incorrect in that … | |
Re: >I was wondering if a mechanism like the "Flag Bad Post" >option on forum posts would be useful on the PM interface. I'm torn on this. On the one hand it's a good idea. On the other, we don't have the rule framework in place for dealing with problematic PMs. … | |
Re: >I believe it wants us to write a program that we input a number, and we >have to be able to output how many digits are output to a particular base. That's trivial too. numdigits as it stands is specific to decimal only because it uses literal 10's in the … | |
Re: >It's because I'm going to generate poisson random deviates for parallel-programming >and I need it to be seed-less to ensure concurrent execution. No, you just need the seeding mechanism to work properly for your concurrent processes. However, you didn't specify what "work properly" means for you. Do you want each … | |
Re: >what facet of the IT world would you advise a newbie like me to venture in The one you find most interesting. Or if you have no preference, get a taste of them all until you do. >or which do you think is easiest? Of those listed I think networking … | |
Re: >Is C++ going to barf on that Possibly. It depends on whether A contains data members and if having multiple copies of the A subobject within a C object would cause problems in your code. Virtual inheritance was introduced to alleviate these kinds of problems. | |
Re: >I want the discussion to be related to my requirements, please. You didn't specify any requirements that can't be achieved with either language. Pick the one you're most comfortable with. | |
![]() | Re: I'll go out on a limb and guess that you're using Visual C++ 6.0, where your problem is a [url=http://support.microsoft.com/kb/240015]known bug[/url]. ![]() |
Re: Command line arguments are passed as parameters to main. The first parameter gives you the number of arguments (including the program name) and the second gives you an array of strings containing the actual arguments: [code=cplusplus] #include <iostream> int main ( int argc, char *argv[] ) { // The first … | |
Re: >no i cant. So what you're saying is that you're unwilling or incapable of searching Daniweb, Google, or any book on C. This is a dreadfully simple problem and the question is asked quite frequently. >can you pls help me? No, you're beyond help. If you can't be bothered to … | |
Re: >printf("i_in: %d \n j_in: %d \n Value: %lg \n", &i_in,&j_in,&p_in); You're printing the value of the address of each of those variables. Remove the address-of operator. | |
| |
Re: >flush is a function so you need to use () cout.flush() std::flush is a manipulator, that part was fine. >Try this macro That still won't work as the construction is illegal. >What I'd like is a way to print the information at compile-time. That brings up the question of where … | |
Re: >I can't get my program working when I put !finBinary.eof(). Put it where? Why don't you post the code you're asking a question about so we don't have to guess? >Google'ed and found out that binary files have some characters similiar to eof? That's a different eof. There's the physical … | |
Re: >I Believe my problem is that the string is in a "private" object That's the way it should be. I've had to smack co-workers on the head before for solving this problem by making those data members public. :icon_rolleyes: Anyway, you can access the data from another form through properties … |
The End.