2,045 Posted Topics
Re: [icode] input[8] [/icode] is not the last member of your array, [icode] input[7] [/icode] is. When you declare the array you put the size, when you use the array, you put the index. After taking in the input, you could say [code] if(input[7] != '\0') input[7] = '\0' [/code] What … | |
Re: The sizeof() operator is giving you the size of the pointer named "buffer", which is 32 bits (4 bytes). Just use bufflen for the size of the buffer in the get() call. | |
Re: Check out [url]http://drdobbs.com/cpp/229218807?queryText=counting+references[/url] from Dr. Dobbs last month, I don't know if it's along the lines of what you are looking for. And yes, I agree with thekashyap, at least tell us what you've Googled about. | |
Re: [QUOTE=happygeek]Can I just add that what I'd like to achieve is a night of passion with Avril Lavigne. What's stopping me is the wife...[/QUOTE] Why choose? ;) | |
Re: [quote]You have made a way to resolve code half-life, but missing something I want to help it .. Fuvction which solving the equation of the third degree in how to enter transactions have, I mean how can I insert s q v g [/quote] I apologize, but I only get … | |
Re: What did main look like where you were trying to instantiate the object? | |
Re: Since you're not asking about C++ explicity, do you have access to Matlab? There is a command called quiver3 that might be exactly what you are seeking ([url]http://www.mathworks.com/help/techdoc/ref/quiver3.html[/url]). It looks like octave might have something similar as an add on ([url]http://octave.sourceforge.net/octave/function/quiver3.html[/url]). | |
Re: Take a look at the example at the bottom of [url]http://www.cplusplus.com/reference/string/string/find/[/url]. | |
Re: Are you allowed to change the signature of the check2 function? | |
Re: Please make an attempt at the code and post it with specific questions. | |
Re: Which windowing library are you going to use? I think Dev has the Win32 API included (good tutorial here [url]http://www.winprog.org/tutorial/[/url]). You might be better off starting with another GUI option like Qt (which will come packaged with a newer version of g++ than you have with DevC++). | |
Re: Unarchive it to a directory. There's a MSW directory that contains a VS project. Open that up and build it. Check the lib directory for the lib files (it probably does a debug build initially, so you may have to do a release build later). After that's all built, go … | |
Re: I'm sure no one would get upset if you did more than the allotted set. My perception is that most lecturers here in the states have a predefined set of learning objectives (put forth by the department or a curriculum committee), and they have to try to adhere to that … | |
Re: That version of getline needs a streamsize, so for example [icode]inFile.getline( PetID[counter].status, ' \n ');[/icode] should be [icode] inFile.getline( PetID[counter].status,6, ' \n '); [/icode] (6 being the size of the status array) and really you can leave off the '\n' as that is the default. You're not taking in the … | |
Re: That's a great quote for your sig: [icode]"Nobody goes there anymore; it's too crowded."[/icode] -Yogi Berra | |
Re: [quote]I have ADD[/quote] I'm sure you've got a few other opcodes too, like MUL or something. I'm going to duck to avoid whatever you have just thrown at me. Me, I do it for the parties at the mansion in Long Island, all the fast cars, speedboats, caviar...a chance to … | |
Re: Where do you modify c2 in the loop? Also, why is it a double? | |
Re: Your inner loop is going to control the columns (it's a bit confusing because people usually specify dimensions as m rows by n columns, but you've done the opposite), so the [B]inner[/B] (j loop) should go to [B]m[/B] and your [B]outer[/B] (i loop) loop should go to [B]n[/B]. So your … | |
Re: Change the inner loop to [icode] for(eq_2 = head; eq_2!=nil; eq_2 = eq_2->tail) [/icode] (substitute whatever your head pointer actually is), that way the second loop gets reset to the beginning of the second list. I think that's what you're trying to do...please clarify if it's not. | |
Re: Any for loop can be transformed into a while loop: [code] for(int i = 0;i<max;i++) { //stuff } is equivalent to int i = 0; while(i<max) { //stuff i++; } [/code] | |
Re: The quick and dirty way is to save them both out to text files (with Save As...) and go the getline route. The 07 and later .docx is XML based, but it's still a binary file, I believe. | |
Re: Someone has apparently heard your request and started one moments ago on [URL="http://embed.mibbit.com/?userListWidth=50&server=irc.daniweb.com%3A6667&chatOutputNickWidth=80&channel=%23Daniweb"]IRC[/URL]. ;) (I can't take the credit, it's been there already) | |
Re: You need to "forward declare" FriendClass at the top of MyClass.h. On line 6, put [icode] class FriendClass;[/icode]. This tells the compiler that such a thing exists so it doesn't complain when it runs into the symbol in the MyClass declaration. | |
Re: There's a fantastic way to check the output of any source code ;) Please explain your rationale for your answers, they are not correct. | |
Re: Train yourself bit by bit to also appreciate the "big picture" ideas. What is it telling you about inheritance? What are some of the relationships between classes? If you focus too much on the minutiae, you'll miss the overall point, which is the thing that is likely to be tested … | |
Re: I'm sure people will come up with other methods that are better (or better suited for the situation), but look at [url]http://cplus.about.com/od/howtodothingsi2/a/timing.htm[/url] at least for a reference as to some of the issues, and perhaps how to get a little more resolution out of the timer, YMMV. One thing that … | |
Re: For the first part, you'll have to use a global hook, see [url]http://www.daniweb.com/software-development/cpp/threads/292475[/url] and the related MSDN. For the second part, check if certain values have been defined (an older thread, so I don't know if there are new versions): [url]http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/3abd4c16-d412-4dbf-a958-eb3b8c05b4bf/[/url] | |
Re: [QUOTE=jwenting] Stalin said that "religion is the opiate of the masses", but in our society that place has been taken by crackpot "supernatural phenomenon" and conspiracy theories.[/QUOTE] It was Karl Marx. Lenin said something like it later on. [url]http://en.wikiquote.org/wiki/List_of_misquotations[/url] | |
Re: See [url]http://en.wikipedia.org/wiki/Stdlib.h#NULL[/url] as to some of the variants and rationale. | |
Re: [quote]platform specific implementation[/quote] [quote]make system calls portable[/quote] If something is platform specific, then by definition it is non-portable. Just skip the "cls", it takes away control from the user and can, IMO, become annoying. If you need that kind of control, use a portable library like pdcurses. This thread is … | |
Re: == does not work to compare strings in C (nor does >=). Use the strcmp function in the string.h header. Here's a reference [url]http://www.cplusplus.com/reference/clibrary/cstring/strcmp/[/url] (ignore that it's on a C++ site). | |
Re: [quote] I was wondering if anyone could help me out on this library[/quote] Which library are you trying to use for the Bluetooth? | |
Re: Is it a sort you are looking for? Please try to be as clear as possible [icode] tnx guys for d help. any help. pls. im needing dis for my defend.[/icode] sounds like your texting your friends instead of asking colleagues for help. | |
![]() | Re: Think of the letters as having a place value, 'a' = 0, 'b' = 1, so "aa" is 0*25+0, "ab" is 0*25+1, "zz" is equal to 25*25 + 25 (check my math, lol). To get the value of a character, subtract 'a'. EDIT: arkoenig's got it (and in much nicer … ![]() |
Re: [icode]break;[/icode] on 19 and 21 is taking you out of the loop completely, what you want to do is increment k and [icode]continue;[/icode]. Also, you employ something like [url]http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes[/url] because you're only testing for 3 factors. | |
Re: What is the actual assignment? Those are very large numbers to be using fundamental types. Perhaps your instructor wants you to implement a "BigInt" type class using arrays. | |
Re: I looked around and ended up with the same information that you did, but read this [url]http://cboard.cprogramming.com/c-programming/55152-trouble-strndup-function.html[/url] (especially the post from Salem) about the compiler switch -ansi being incompatible with the non-standard functions (you don't use any switches in your example above, but I didn't know if the server had … | |
Re: [quote] I hope this Mhaoti completions with me [/quote] I appreciate the fact that English is not your first language, but I have no idea what you are trying to say there. So what are you trying to do with this function? Take the integral of it? | |
Re: what's the value of _selectedName at that point? | |
Re: Check out something like [url]http://www.codeproject.com/KB/IP/csmtpconn.aspx[/url]. I've never used it, I just ran across it. | |
Re: Resetting your counter to 10 at the bottom of the counter will cause it to run forever if you can't find the item, I'm not sure what you're trying to do there. I would copy/paste all of your code into a separate file and strip out all of the output … | |
Re: You need at least an [code] [B]int main(void)[/B] { return 0; /*else compiler complains about falling off the end */ } [/code] Probably can trim out some of that, but this is a safe bet | |
Re: I don't understand what about "cond" makes it output the second line? (did you mean "second"?) How would you output the first? You'll have to take in arguments from the command line (look up "argc and argv" for lots of examples). | |
Re: [icode]strcpy(dest,source) [/icode] copies the source to the destination EDIT: [icode] strcpy [/icode] returns the destination string, you're treating it like it returns a concatenated one. What you need is to [icode] strcpy [/icode] Scards into Tcards and then use [icode] strcat [/icode] to add Ncards to Tcards. Make sure Tcards … | |
Re: [quote]after deleteing I want to show the array contents........ [/quote] That doesn't make one bit of sense. Also, why are you trying to delete the array multiple times, [icode] delete [] array; [/icode] takes care of it. | |
Re: [url]http://beej.us/guide/bgnet/[/url] is one of the most referenced sources. I've never used it, so no guarantees. Other than that, make sure your fundamentals are sound before delving into the network programming. Have you worked in other languages before? | |
Re: Use a cast? C++ style: [code] double a = 1.40; int x = static_cast<int>(a); [/code] "C style" (still valid) [code] double a = 1.40; int x = (int)a; [/code] You will lose all digits after the decimal and it doesn't round, just truncates. | |
Re: [quote]unless reputation in this forum doesn't count[/quote] Nope. Hehe. |
The End.