2,867 Posted Topics

Member Avatar for jobra

> 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...

Member Avatar for John A
0
136
Member Avatar for bigben09

Little typo I noticed in your code: [code]if (integer [cntr] == '0'&&f[COLOR=Red]=[/COLOR]1)[/code]

Member Avatar for John A
0
128
Member Avatar for jbennet

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 …

Member Avatar for jbennet
0
139
Member Avatar for bigben09

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. …

Member Avatar for ~s.o.s~
0
274
Member Avatar for superlox3

[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 …

Member Avatar for Lazaro Claiborn
0
114
Member Avatar for donaldunca

[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 …

Member Avatar for donaldunca
0
231
Member Avatar for srinath33

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]

Member Avatar for goutham_see
0
3K
Member Avatar for enonrub

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 …

Member Avatar for jbennet
0
70
Member Avatar for EnderX

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 > …

Member Avatar for John A
0
960
Member Avatar for Joe689

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.

Member Avatar for Joe689
0
2K
Member Avatar for boujibabe

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 …

Member Avatar for boujibabe
0
279
Member Avatar for tech291083

> 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]

Member Avatar for tech291083
0
105
Member Avatar for unclepauly

[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 …

Member Avatar for thekashyap
0
233
Member Avatar for raydogg57

[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? ;)

Member Avatar for John A
0
2K
Member Avatar for abhishekmittal
Re: c++

>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 …

Member Avatar for John A
0
126
Member Avatar for Duki

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.

Member Avatar for Duki
0
172
Member Avatar for SHWOO

[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? …

Member Avatar for iamthwee
0
249
Member Avatar for dalton

[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 …

Member Avatar for iamthwee
0
806
Member Avatar for humbug

[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 …

Member Avatar for Rashakil Fol
0
141
Member Avatar for Ancient Dragon

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...

Member Avatar for Dani
0
99
Member Avatar for Marks256

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 …

Member Avatar for Marks256
0
411
Member Avatar for John A

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 …

Member Avatar for jbennet
0
353
Member Avatar for rhythm

[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. …

Member Avatar for John A
0
708
Member Avatar for Tauren

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 …

Member Avatar for Phaelax
0
148
Member Avatar for GreenDay2001

[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]

Member Avatar for jbennet
0
129
Member Avatar for bukaj

>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 …

Member Avatar for bukaj
0
171
Member Avatar for tinie

[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, …

Member Avatar for tinie
1
5K
Member Avatar for lotsofsloths

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 …

Member Avatar for Lazaro Claiborn
0
321
Member Avatar for torbecire

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, …

Member Avatar for John A
0
104
Member Avatar for The Dude

[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 …

Member Avatar for Ancient Dragon
0
108
Member Avatar for jbennet

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. …

Member Avatar for maui_mallard
0
243
Member Avatar for marvviki

Tried DaniWeb's code snippets library yet? [URL]http://www.daniweb.com/code/[/URL] Probably not good enough for you, though....

Member Avatar for John A
0
21
Member Avatar for trunks1212

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 …

Member Avatar for John A
0
163
Member Avatar for nadith_cs

> 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 …

Member Avatar for iamthwee
0
112
Member Avatar for kobi

[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]

Member Avatar for Ancient Dragon
0
393
Member Avatar for Rickenbacker360

[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, …

Member Avatar for psycotic_furby
0
123
Member Avatar for ostkaka

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 …

Member Avatar for pty
0
231
Member Avatar for tinie

[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]

Member Avatar for Lazaro Claiborn
0
135
Member Avatar for Danarchy

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.

Member Avatar for Danarchy
0
91
Member Avatar for MidiMagic

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 …

Member Avatar for MidiMagic
0
124
Member Avatar for Tauren

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 …

Member Avatar for WolfPack
0
126
Member Avatar for andy257

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 …

Member Avatar for ~s.o.s~
0
143
Member Avatar for John A

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? ;)

Member Avatar for ~s.o.s~
1
83
Member Avatar for suwaiz

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 …

Member Avatar for magacitl
0
191
Member Avatar for mattyd

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.

Member Avatar for mattyd
0
128
Member Avatar for cusado

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 …

Member Avatar for Lazaro Claiborn
0
244
Member Avatar for natural

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 …

Member Avatar for natural
0
77
Member Avatar for Aia

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, …

Member Avatar for John A
0
222
Member Avatar for Tauren

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 …

Member Avatar for John A
0
131
Member Avatar for Tauren

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 …

Member Avatar for jbennet
-1
90

The End.