2,867 Posted Topics
Re: Probably because you're outputting the 'char' as a 'char array'. [code=cplusplus]printf("The first char is %s\n", fchar);[/code] Try changing [icode]%s[/icode] to [icode]%c[/icode]. Some other things... - [icode]fchar[/icode] should be an integer. This way, you guarantee that it can hold an EOF character when the end of the input buffer is reached. … | |
Re: If your computer has been compromised, you should do a complete reformat and reinstallation of the operating system, the only thing that you should backup is data. The reason for this is that hackers may have installed root kits, trojans, and other programs that pretend to be your normal applications … | |
Re: This is the important part: [quote]Since the prefix and postfix ++ operators can have two definitions, the C++ language gives us two different signatures. Both are called operator++(), but the prefix version takes no parameters and the postfix version takes a dummy int.[/quote] In other words, if one didn't have … | |
Re: Could you post this code in a bit more context? Also post the source code of [icode]count()[/icode]. | |
Re: Please use [URL="http://www.daniweb.com/forums/announcement8-3.html"][B]CODE[/B] tags[/URL] in your code. You typed right over the watermark that explained how to use them. | |
Re: Please use CODE tags when posting code. Their usage is explained in the watermark that you typed over when you wrote your post, and in the announcements in this forum. As for your problem, it's very simple. Change this line from: [code=cplusplus]if ( a[i] < a[j] )[/code] To: [code=cplusplus]if ( … | |
Re: >Can anyone tell me what's wrong with the code? Why don't you tell us what doesn't work? | |
Re: You should have one overall do...while loop with all your other submenus nested inside with their own do..while loops. This way, when the menu selection has finished its processing, it will loop back to its parent menu (or in the case of the main menu, exit). | |
Re: I refuse to read your code until it's properly formatted. | |
Re: The Mac OS X EULA is pretty clear about this subject: [quote]2. Permitted License Uses and Restrictions. A. This License allows you to install, use and run one (1) copy of the Apple Software on a single Apple-labeled computer at a time. You agree not to install, use or run … | |
Re: [QUOTE=hyperzero4;536378]I know how to open the file from a program I found online: [code] // reading a text file #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("word.txt"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); } myfile.close(); } … | |
Re: My guess would be that you don't have a Java Runtime Environment setup on your system. It's most likely in the YaST repositories, so start up YaST and search for Java Runtime Environment (JRE). Once you find it, install it, and it should set up your Java environment correctly. If … | |
| |
Re: Creating Trojans to mask the presence of monitoring software falls under the "Keep It Legal" rule in place here. Despite your personal situation, I don't think anything positive will come from this thread, and I also think it's in DaniWeb's best interests to prevent discussion on this subject. If a … | |
![]() | Re: The best method is just to make a header file for every source file. Source files aren't really supposed to be #include'd anyway, for the very reason you had your error. |
Re: >I need instructions for shrinking /dev/sda1 GParted can resize ext2 and ext3 partitions. Read the documentation if you need more information on this (although the program UI is pretty straightforward). >as well as creating the other two partitions Use the "New" button/option in GParted, with the free space selected. Again, … | |
Re: Just curious, but what are the contents e-mail.h and e-mail.cpp? (Abbreviate it if it's a bit long.) You don't need *.lib files because you're not using an external library. | |
Re: [QUOTE=ithelp;536060]Not that easy, I guess you need to parse a complex expression like a+b-c*d and evaluate, you need to learn about binary search tree, and about postorder traversal ,etc.[/QUOTE] Not necessarily. If it's just a simple calculator program (as the original poster seems to be implying), then the program itself … | |
![]() | Re: I'm probably just going to go skiing with some friends. It's not a big deal for me. |
Re: If you still have your OS X installation disk, you can most likely repair your system. Boot off it by inserting it into the disk drive, and holding down the 'C' key while the computer starts up. After you enter the installation program, from the 'Utilities' menu, choose 'Disk Utility'. … | |
Re: It's not an error. Windows automatically closes console applications once they're finished. To pause the program before it quits (so you can view the console output), put [icode]getchar();[/icode] at the end of your program. | |
Would it be possible to disable smileys within [noparse][icode][/noparse] tags? For example, [icode]MainNamespace::[b][/b]SystemClass::[b][/b]sca[b][/b]red::[b][/b]PThread();[/icode] Turns into [icode]MainNamespace::SystemClass::scared::PThread();[/icode] Okay, exaggerated example. But you get the point. | |
Re: Don't know, but since you don't have the source code, regardless of whether it's C/C++ or not, why post in this forum? Perhaps the *nix forums would be a better place for this thread. Oh, and I kind of doubt you can migrate the executable, unless you maybe use a … | |
Re: Internet Explorer 7 works excellent and is a much-needed upgrade to the IE 6 series. In particular, tabbed browsing is nice, its performance is good, and it actually looks half-decent. The fact that you had so many problems with it is probably because a) you don't know how to use … | |
Re: If you're referring to kernel drivers (modules), you can list the currently loaded modules with [icode]lsmod[/icode]. | |
Re: Register at [url]http://vmware.com/download/player/player_reg.html[/url] which will provide you with your free serial number. Don't bother with the RPM as this is meant for Red Hat-based systems and probably won't work on Ubuntu. | |
Re: I apologize, I'm kind of jumping into this thread without having read the rest of it, but you're using iterators wrong here: [code=cplusplus]if(*it->expo == *it2->expo && *it->var == *it2->var)[/code] The *'s are unnecessary. To access a member using an iterator, just do [icode]it->member[/icode]. Also, here: [code=cplusplus] r.co = *it->co + … | |
| |
Re: Hi, and welcome to DaniWeb. If you have another Mac and a firewire cable, you might be able to use Target Disk Mode. Connect the Macs with the firewire cable, start the Mac that works, and once that's booted up, start the dead iBook, holding down the 'T' key. If … | |
Re: First, read stickies and readmes scattered liberally around the forum. In particular, you seem to have missed the readme on [URL="http://www.daniweb.com/forums/announcement8-3.html"][B]CODE[/B] tags[/URL]. Grab several variables from the standard input using multiple inputs. The user can enter them all on one line (whitespace-separated), or they can enter each one on a … | |
Re: >can I combine int main() and void main() in 1 programming.?? Yes. Use the former, stop using the latter. [url]http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?id=1043284376&answer=1044841143[/url] | |
Re: >and I'm sure it's not right. Nope. [icode]fread()[/icode] returns the number of successfully-read elements. You need to convert the char from buffer into an integer. If you'll take a look at an [URL="http://www.asciitable.com/"]ASCII table[/URL], you'll see that characters are just decimals. You'll also see that numbers are stored as decimals, … | |
I think we've all observed the trend of eye candy incrementally increasing in the user interface of consumer operating systems, particularly the commercial ones. Vista's Aero and OS X's Aqua are perfect examples: both use large amounts of transparency, and contain "sparkle" in the windows designed to enhance a user's … | |
Re: You should really consider using arrays for some of your data. For example, you could create an array that contains the number of days in each month. Your advance_date() function would be considerably simpler: [code=cplusplus] day++; // check to see if this is the last day of the month if … | |
Re: It's times like this where I think it would be simpler to use a function. Follow the previous advice of WaltP, creating a [B]while()[/B] loop. This function will keep looping until the user enters a non-negative integer. [code=c++] int getPositiveInt() { int value = -1; cin >> value; // keep … | |
Re: It looks like you learned an important lesson a bit painfully: [B]always back up[/B]! I don't know what happened to them, but if the only copy you had of them was supposedly in the zip file you sent your teacher, I'd say it's your own fault you lost all your … | |
Re: >How to locate the text file What do you mean by this? Do you mean "open" the file when you already know the name? Or are you searching for a text file on your hard drive? >How to input values in that text file >How to read the texts in … | |
Re: And you're likely experiencing problems with the std:: namespace. Try prefixing [icode]cout[/icode] and [icode]endl[/icode] with [icode]std::[/icode]. Or, if you don't like doing that, just add [code=cplusplus]using namespace std;[/code] after you include <iostream>. | |
Re: In the future, if you've found that your thread or another thread is posted in the wrong forum, please flag it for the moderation team to move. Posting a question more than once violates the "keep it organized" rule and is harder for the mod team to keep track of. … | |
Re: I'm shocked that you care enough about this to post a poll about it. Well, actually, not shocked. Just disappointed. | |
Re: If you had all the money in the world, how would you expect to find a market in which you could buy a house? | |
Re: I've got everything from calculator manuals and tuxedo buttons to fungal cream and foreign currencies. The only thing I keep clear is a path to my monitor so I can see what's on my screen. | |
Re: Okay, I don't know if you're trying to install Linux alongside Windows (so you can dual-boot), or whether you've completely erased Windows and are trying to create a purely Linux-based system. In any case, I'd recommend the following setup for your Linux partitions: [LIST] [*]A swap partition that will be … | |
Re: I'm not using Firefox right now, but I believe it has a 'save link as...' option in the contextual menu that results from right-clicking on a link. [edit] I've moved this thread to the Web Browsers forum so it's more relevant. | |
Re: [code=cplusplus] case 4: quotient = num1 / num2; if( num2==0){[/code] Shouldn't you be checking to see if [icode]num2[/icode] is 0 [I]before[/I] you divide? After all, that's most likely what's causing your program to segmentation fault. And you should change your [B]if()[/B] statement into a [B]while()[/B] statement so that it keeps … | |
Re: [QUOTE=thodragon;530904]"You don't get the grade", "that's charity". Next thing is to send me your bank account!! I asked for help. Do you know what does the word "help" mean? What am I saying? You are mr smart guy, of course you know. I didn't make you to do it. I … | |
Re: The way you're reacting to it right now seems to indicate that you're more of a "baby" than the members who are giving you the negative rep. In any case, what you don't seem to realize is that firstly, rep is not meant to be taken seriously. It's designed to … | |
The End.