2,867 Posted Topics
Re: > Why do you have the line temp++? It doesn't seem like that would do what you want. True, although it's unlikely to be causing syntax errors... Don't know what happened in the OP's last post, but the code snippet was completely butchered, too... | |
Re: Little typo I noticed in your code: [code]if (integer [cntr] == '0'&&f[COLOR=Red]=[/COLOR]1)[/code] | |
Re: DaniWeb should count as volunteer work. Maybe if you ask really nicely Dani will write you a letter of recommendation... :cheesy: Anyway, I agree with everyone else on this thread. MacDonald's isn't going to be like anything where you actually have to use your brain (or skills)... I wish you … | |
Re: What I would do is flip the number like you mentioned, but instead convert the number back to an integer with a stringstream. [code]std::stringstream myStream; int completeNumber; myStream << backwardsNumber; myStream >> completeNumber;[/code] When you convert the number back to an integer, any leading 0s will automatically be snipped off. … | |
Re: [quote=superlox3;317484]I don't understand strings at all. I looked at the tutorial but I still don't get it... Is there any tutorial that can be easily followed for inputting strings (no skimmers)?[/quote] Explain:[LIST] [*]What tutorial you read [*]Was it a C or a C++ string? [*]Is there something particular that you … | |
Re: [quote=donaldunca;316389]... but it stop reading at the first line and not jump to second line. Could you help me at this point? thank you![/quote] I've experienced problems with fgets() not stopping at each line before. It turns out that the file I was using was from MacOS 9, which used … | |
Re: Speak English please. And once you do that, you can show some effort. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url] | |
Re: Sure, what do you want to stream? Results may vary depending on bitrate. A lower-quality video will likley run at a quite good framerate; a higher one may not work so well. Part of this might be due to your internet connection: if you have dial-up, it's your internet that's … | |
Re: I think this is what you want (correct me if it isn't): [code]find / -name *** -print > ~/file.txt[/code] Basically you use the redirect symbol '>' to send the output of a particular *nix command into a file. You can also append output to an already-existing file; just replace > … | |
Re: The problem lies in the formula you're using to calculate the 1 dimensional array. It should be: [code]i*length*width + j*width + k[/code] Since i is represents not only a row but also a column, you're going to have to multiply it by both to get a correct index value. | |
Re: Some points:[LIST] [*]To guarantee that a particular integer will always be postive (absolute), declare it as an [inlinecode]unsigned int[/inlinecode].[/LIST][LIST] [*]You check to see if the value the user entered was larger than 100, but you never checked if it was smaller than 0.[/LIST][LIST] [*]You can use [inlinecode]break[/inlinecode] to jump out … | |
Re: > Ever wondered how Microsoft is run and by who: That's nothing. [URL]http://www.youtube.com/watch?v=m6rqXHX3O48&eurl=[/URL] [URL]http://video.google.com/videoplay?docid=6304687408656696643[/URL] Here's good videos if you're a programmer or a workaholic: [URL]http://youtube.com/watch?v=gvz4aY7nvNQ&search=programming[/URL] [URL]http://www.youtube.com/watch?v=-xEzGIuY7kw&eurl=[/URL] | |
Re: [quote=unclepauly;316798]so i guess this changes the question slightly. how to make the static function access the other members of the class? can it be done?[/quote] You can't. Static members are exactly that: static. They're the same throughout all instances of the class; in fact they don't [I]need[/I] an instance to … | |
Re: [code] bool get(int &data); // always get the data of the current head { if (m_buffer == 0) return false; else { m_head[COLOR=Red] *=[/COLOR] data;[/code] Is this [I]really[/I] what you want to do? ;) | |
Re: >why and how it is possible ? When you explicitly place a "thing" into global namespace the compiler throws an error if there's ambiguous naming, because you declared it exactly. When you place entire namespaces in global scope, everything is included implicitly. That means that you're allowed to do what … | |
Re: The only thing I can see wrong with your code is this loop: [code]while (!inFile.eof())[/code] What is the point of it since you never read anything else from the file? Furthermore, if the end of the file is reached before that statement, the whole switch() statement is completely skipped. | |
Re: [quote=~s.o.s~;316850]The program looks good. Mind posting the line numbers and the exact errors you are getting.[/quote] ~s.o.s~ is right, at first glance it doesn't seem like there's anything wrong with the code. I just tried compiling it, and it compiles without any errors on gcc. What compiler are you using? … ![]() | |
Re: [quote=Aia;317010]I followed your link because now I'm intrigued about atoi, however is for C++ and I don't know anything about it. Do you have another link that shows why is bad to use that function in C. I have used it several times, in the past, following books examples.[/quote] See … ![]() | |
Re: [quote=humbug;316580]Nothing about programing in the instruction manual.[/quote] Then the instruction manual is crappy. A manual should document every feature a device has (or at least the major ones). But do you really think we can help? It's highly unlikely that one of us will have that calculator, so you're pretty … | |
Re: I think the feeds only show the latest threads, not the lastest threads that have been posted in. I just checked with Firefox's RSS reader, and everything works as expected. If there's a problem, it must be on your end... | |
Re: C# is best for designing interfaces. It is not entirely dissimilar to Java, as it needs a runtime environment in order to execute, which affects performance. However, you can't beat the speed and drag-and-drop ease of creating applications you get from using C#. :) C/C++ are much lower-level, allowing you … | |
Heh, this is my latest website I visit when I'm bored: [URL]http://www.rinkworks.com/stupid/[/URL] It amazingly has huge numbers of stories from tech-support guys trying to fix people's computer problems. My fav: [quote][LIST] [*] [B]Tech Support[/B]: "Ok, let's put your operating system disk in the drive." [*] [B]Customer[/B]: "Ok...which way does it … | |
Re: [quote=rhythm;317041]i don't know how the smiley face got in there, please ignore it, it's not part of the code of course.[/quote] The smily wouldn't have appeared if you had used [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]code tags[/URL]. So what happens when you try to run it? Or compile it? Otherwise we just end up guessing. … | |
Re: Ah, FullSail. That's the college I was thinking of. I've read several articles about them, and it's supposed to be a very good college. What [B]Phaelex[/B] said about FullSail is true; that is, it's [I]very[/I] expensive, and students generally sleep during the few daylight hours that they have; often coding/drawing … | |
![]() | Re: [quote=The Dude;316552]Why noy put the ad space UNDER the quick reply box Dani?[/quote] [URL]http://www.daniweb.com/techtalkforums/post310978-44.html[/URL] |
Re: >HI, can somebody help with this? Sure. What do you need help with? Like we're going to translate your source code for you just because we feel like it. :rolleyes:[LIST] [*]It's in Slovak. I don't know of any other people here who can read Slovak. [*]You haven't shown any bit … | |
Re: [quote=tinie;316622] I tried inserting the line [inlinecode] v.at(2).insert(col_it-5, 99);[/inlinecode] at line 27, but what I get is a segmentation fault message (I'm doing this in Linux).[/quote] Not surprising. In the first iteration, [inlinecode]col_it[/inlinecode] is equal to the beginning of the first column. Now you try to subtract 5 from it, … | |
Re: You could greatly simplify your program if you used arrays instead of numbered variables. You'll want to use 2-dimensional arrays, as it will make your program easier to write. Since it's a 3x3 grid, declare it like that: [code]bool myGrid[3][3];[/code] You'll want to create a seperate function for drawing the … | |
Re: Your problem is here: [code]cout << p.replace(i, [COLOR=Red]i[/COLOR], x) << endl;[/code] The first argument specifies the starting index. The second character does [I]not[/I] specify the ending index, as you assumed here. It's the number of characters to replace, which in this case is 1. Replace the i with a 1, … | |
Re: [quote=WaltP;316402]But it's yogurt! If I want spoiled milk I'd just leave it in the fridge for a while.[/quote] Perfect description :cheesy: It looks like some white stuff from an animal! I don't [I]care[/I] how many health benefits it has; I'd rather have a cold than have to eat that horrid … | |
Re: For some reason, needles in my arm don't terrify me. They hurt sometimes, and although I can't really say that [I]like[/I] getting needles, I'm don't dread getting them. However, needles in my mouth terrify me far more. For one thing, they hurt a lot more than needles in my arm. … | |
Re: Tried DaniWeb's code snippets library yet? [URL]http://www.daniweb.com/code/[/URL] Probably not good enough for you, though.... | |
Re: Consider initalizing your grid properly... [code] char board[SIZE][SIZE] = {' ',' ', ' ', ' ',' ', ' ', ' ',' ', ' '},[/code] Simply doing one like you did in your code only initalizes the first element in the array. Anyway, I don't have time right now to find … | |
Re: > and please note that i have made comments on the lines which compiler gives an error. > actually it compiles really well. If you say that it compiles well, how come it has so many "errors"? A good idea would be to post the code here instead of including … ![]() | |
Re: [quote=Ancient Dragon;314396]you need to add a line before the return to make the program stop so that you can read it. This will do ok [code] system("PAUSE"); [/code] [/quote] Except that the statement isn't in the least bit portable... Much better alternative: [code]cin.get();[/code] | |
Re: [quote=psycotic_furby;315892]Correct me if I'm wrong (first post, it's quite likely!) but I [I]think[/I] this does need to be an and - he want's to know if the number is divisible by seven AND two, not one or the other.[/quote] Yes, it does look like WaltP slightly misread the code... However, … | |
Re: It sounds like your $DISPLAY variable isn't set correctly. What I would try first is something like this: [code]# DISPLAY=0:0 wine SteamInstall.exe[/code] And see what happens. I've read that this problem is quite common on Wine, and there often isn't an end-all fix for this. Is this application listed under … | |
Re: [code]fflush(stdin);[/code] NO NO NO NO! That's the worst possible thing you can do. [URL]http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351[/URL] For proper input techniques, check out Dave Sinkula's excellent input tutorials: [url]http://www.daniweb.com/tutorials/tutorial45806.html[/url] | |
Re: As far as I know, the only workaround for saving images to a directory you choose in Safari is by holding down the option key. Another choice is to use Mozilla's [URL="http://www.mozilla.com/en-US/firefox/"]Firefox[/URL], which allows you to choose "Save As..." directly from the right-click contextual menu. | |
Re: Regarding the crashing: perhaps you've discovered another bug in Internet Explorer? What version are you running? And agreed with Sanjay; in fact on any website there should be no need to hit the back button. If there is, or it takes too long to get to a page you were … | |
Re: You're talking about network programming. You send packets through sockets in C, which allows you to setup a client-server interface. [URL="http://beej.us/guide/bgnet/"]Here[/URL] is a good tutorial on sockets. Next time try googling around before asking a question; googling for "packets" would have brought up a wealth of information that would have … | |
Re: First of all, don't you think you're jumping a bit ahead of yourself? You've barely learned C++ when you want to go on to creating fancy GUIs and stuff. GUI programming is another whole can of worms which should probably not be opened until you're confident with the basic concepts … | |
As many of you probably already know, yesterday DaniWeb received a massive amount of spam threads. I want to thank the moderators for deleting all the spam; it makes me really grateful that we have them here. However would DaniWeb manage without the "flag bad post" link? ;) | |
Re: I fail to see the need to split and join the files together to make an executable - why not just allow users to view the videos through a web page? If rapidshare doesn't allow you to do this, find a service that does. There's tons of free web space … | |
Re: The multiple posts probaby have been deleted already; perhaps the other mods know more about it... Another possibility is that the DaniWeb was only [I]displaying[/I] double posts, but the internal database was still accurate. | |
Re: This line is incorrect: [code]sprintf(filename,"%d.txt", [COLOR=Red]stdin[/COLOR]);[/code] Since you've already gotten the input from stdin, you should be supplying the variable which contains the user input as an argument instead of [inlinecode]stdin[/inlinecode]. And since you read it in as a string, you'll want to change "%d" to "%s". Also beware of … | |
Re: Ugh. There was probably a huge powersurge before the outage, which probably fried your power supply unit in your G4. The good news is is that the PSU generally sacrifices itself for the other computer parts, so generally a power surge will not harm other computer parts. As for fixing … | |
Re: You asked this question already. What you should do is create a function that does the screen and file printing; all you have to do is pass the string and the file as arguments. I was thinking something like this: [code=cplusplus]void printToFileAndScreen(FILE *filePtr, char *myString) { if (myString) { fprintf(stdout, … | |
Re: Copy the header file to the same directory that contains the project you intend to use it in. Then wherever it is needed, simply insert [code]#include "whatever.h"[/code] And it should work. You can also use working directories (. and ..) to reference directories in your hard drive, although it's generally … | |
Re: I don't want to sound rude, but what exactly is the point of this message? I don't care enough to look and find out what AIM was written with, and why would I care? Even if it were written with Java, it's NOT a Noob language. Many good applications were … |
The End.