5,727 Posted Topics

Member Avatar for C++Newbie

you should anyway use ifstream instead of fstream for reading... Omitting all errorchecking, the following will read and echo lines from a textfile: [code] #include <fstream> #include <string> #include <iostream> #include <iomanip> int main() { ifstream fs; fs.open("test.txt"); string s; while (fs >> s) cout << s << endl; fs.close(); …

Member Avatar for jwenting
0
564
Member Avatar for fwongmc

Before you can debug it you have to get it to compile. Start with the very first compiler error, solve that one. That alone may well solve a lot of other errors. Your dispense function is seriously flawed. Not just will it generate quite a few compiler errors, the logic …

Member Avatar for jwenting
0
137
Member Avatar for kama

in fact, he's done nothing at all beyond declaring some variables and function prototypes (which were probably just copied from the assignment paper). Do your own homework kama, it's the only way you'll ever learn anything. Questions like yours make me believe there should be a minimum requirement of a …

Member Avatar for anastacia
0
5K
Member Avatar for blackbabydoll

any function that takes more than 3 arguments suggests heavily you would benefit greatly from encapsulation. Think up some classes for starters. What does it do, and what do you expect it to do? Use a debugger to go through your program and check where it does something unexpected, that …

Member Avatar for jwenting
0
110
Member Avatar for halyoung

Quite possible. What fileformat did you save them as on the mac? And did you format the flashdrive on the mac? That could make it impossible for a PC to read (depending on the filesystem you used).

Member Avatar for jwenting
0
46
Member Avatar for Roberto12345

Ever more DVDs feature extensive copy protection. This may prevent them from being played in computers. Just get a real DVD player, they cost next to nothing and the image quality is a lot better on a TV than on a computer screen using some software. It of course makes …

Member Avatar for Catweazle
0
158
Member Avatar for hexonflux

what an idiotic rant that kid puts up... If you don't know how to do things under Windows that doesn't mean Windows is bad kid. It just means you're ignorant and may well be too lazy and/or stupid to even try to understand what you're talking about. Now go back …

Member Avatar for alc6379
0
494
Member Avatar for fatallah

[QUOTE=frrossk]Didn't you read the posts above yours?[/QUOTE] Of course not. Reading is too much hard work, almost as much as coding. In fact, even starting your own thread is too much...

Member Avatar for alc6379
-1
261
Member Avatar for kitakits

Looks like an entire classroom full of kids has gotten their homework assignment and are all posting it at the same time :)

Member Avatar for alc6379
0
738
Member Avatar for wangstarr
Member Avatar for jifiii
Member Avatar for jwenting
0
110
Member Avatar for Feirgon

What you want to do is tantamount to a denial of service attack, don't do it. As to the technicalities involved, there's no need to interact with a browser at all. Just use UrlConnection.

Member Avatar for jwenting
0
110
Member Avatar for fubar

If you're so ignorant about Windows architecture and versions, what qualifies you to make statements like "p stands for patch"? No need to politically correct anti-Microsoft rants here kid. Windows 98 is by now 7 years old, it's end of life. In other words: don't use it, use XP which …

Member Avatar for jwenting
0
99
Member Avatar for George2

only 1 thread can access the file at once as the file pointer WILL move during the read and write operations. Say you're reading and have read 100 bytes. Now the other thread moves in and starts to write after setting the file position 1000 bytes from the end. After …

Member Avatar for George2
0
157
Member Avatar for anastacia
Member Avatar for cybergirl

just when I don't have my Latin dictionary with me. Yes, I used to study Latin in school but I've forgotten a lot of it. That's what happens when you don't use it regularly :( Maybe the official website of the US office of engraving and printing (the guys who …

Member Avatar for cybergirl
0
174
Member Avatar for moderate_rock48

call the chemical waste disposal people to take the stuff away and watch as they scratch their heads as to why computer parts are chemical waste (they are...).

Member Avatar for Cain
0
94
Member Avatar for gowswan

you mean you want to print an octal representation of a decimal number? Check out your language reference for itoa.

Member Avatar for Dave Sinkula
0
121
Member Avatar for matt_5104

Determine the top corner of the component you use to display the image and use those as an offset. For example if the image is displayed from 100,100 on your application window and your mouse coordinates are 150,150 your coordinates in the image would be 50,50 (or was that 49,49 …

Member Avatar for jwenting
0
133
Member Avatar for hopeolicious

that's likely the problem. There's only 1 possibility for that not to be an infinite loop in which case the loop terminates immediately. It's also an empty loop... Most likely the semicolon shouldn't be there and some braces were forgotten.

Member Avatar for jwenting
0
122
Member Avatar for jaeSun

Enlighten me: if you knew in advance it was so easy why even bother asking and not just think about it yourself and get a solution?

Member Avatar for jwenting
0
163
Member Avatar for docetes

run it in the debugger, see what happens. Set some breakpoints and watches and step through your code.

Member Avatar for jwenting
0
160
Member Avatar for melcurt

More likely someone send the offensive messages using a fake address which happens to match your friend. Another possibility is that his machine has been compromised and someone used it to send the offending material. In that case he'll have a hard time proving it wasn't him and may have …

Member Avatar for SeroSX
0
160
Member Avatar for MrScruff

yup. What I find rather troublesome is that he uses System.err for non-error output... It would be much preferred to read the inputfile through the commandline.

Member Avatar for jwenting
0
108
Member Avatar for fulmont99

not using a function that returns an array... You can of course return an array that contains only 1 element.

Member Avatar for fulmont99
0
163
Member Avatar for jonoj

Eclipse and JBuilder are the best in the business. IDEA is supposedly also excellent, I've never used it so I can't tell. I never liked Netbeans/Forte. Poor project management, poor performance and a memory hog (this goes for every version I've used which means every major release). Shall we get …

Member Avatar for jonoj
0
255
Member Avatar for american212001

what you are describing are [b]cracker[/b] tools, not [b]hacker[/b] tools. Despite the media mislabelling crackers as hackers there's a huge difference. Most crackers couldn't hack if their lives depended on it. A hacker is a creative person, often with a rather geeky dry sense of humour. A cracker is purely …

Member Avatar for jwenting
0
154
Member Avatar for dncloud
Member Avatar for jwenting
0
136
Member Avatar for y2sav

why will you only build the system if you make it easier for us to help you? As to the String validation, check out the regular expression package in Java 1.4 and later. It's purpose built for things like that and extremely powerful.

Member Avatar for jwenting
0
118
Member Avatar for Faramba

of course it's homework. If it were not it wouldn't be worded as "do this, do that" which is most likely an exact replication of the text of his assignment...

Member Avatar for jwenting
0
148
Member Avatar for vyk2rr

hmm, getting abusive when someone doesn't know his lingo? Do you know my language? I think not yet I don't mind... If I'm wanting to post on a Spanish language site I'll take the trouble of posting in Spanish (which would be hard since I don't know it). On a …

Member Avatar for alc6379
0
182
Member Avatar for BSaltturk

Why are you combining C++ STL with old-style C constructs anyway? It would become a lot easier if you use list<string> instead (and fstream functions for the file handling).

Member Avatar for khuman_nb
0
1K
Member Avatar for Faramba
Member Avatar for Richard Wong
0
106
Member Avatar for MrScruff

You will have to nest different layout managers. Make a component that is a JPanel with a GridLayout containing a label and a slider (so 1 row of 2 columns). Then add that to your borderlayout where you want it to appear. That way it should line up as you …

Member Avatar for jwenting
0
94
Member Avatar for kiki021600

strstr is a standard function that searches for occurrances of one string inside another. This is exactly what grep does at its most basic. It can indeed not search case insensitive but with a little thinking you will be able to figure out how to use it anyway. Hint: how …

Member Avatar for frrossk
0
128
Member Avatar for Faramba

All it prints is a compiler error and some warnings when compiled using GCC. Correct code is: [code] #include <iostream> #include <string> using namespace std; int main() { char s[50]; strcpy (s, "What "); strcat (s, "does this " ); strcat (s, "do?"); cout << s << endl; return 0; …

Member Avatar for Dave Sinkula
0
84
Member Avatar for boujibabe

[QUOTE=boujibabe]Okay #1,Thanks for the help! #2 I only a begginer so I really don't understand about 60% of it #3 one of the sample outputs says shift 8 places so i'm pretty sure it has to shift more than five places without looping and tempt is an array used int …

Member Avatar for boujibabe
-1
205
Member Avatar for muaaz

simplest sequence (not recommended for large files) without error checking read filename(s). open file with given name for read-only read entire file into buffer close input file open file for output as write-only write buffer from the end one byte at a time close output file

Member Avatar for jwenting
0
81
Member Avatar for ultimate_fusion

A better way is to pass it to the second method as a parameter. Especially since main is static and pulling the variable outside main would cause all kinds of other problems (especially if multiple instances of the class are created).

Member Avatar for ultimate_fusion
0
147
Member Avatar for FlickGuY

Start small, really small. Games are massive undertakings, taking large teams of extremely tallented and highly experienced people years to create. For example, every version of Microsoft flight simulator takes a team of about 50 people 2 years to create and that's possible only by reusing a good part of …

Member Avatar for jwenting
0
99
Member Avatar for hopeolicious

And which is line 94? I'm not inclined to go count your lines and see which generated the error. You probably have a string or character literal somewhere which doesn't have closing quotes. Or else you have a quote somewhere where it doesn't belong leading the compiler to think you …

Member Avatar for hopeolicious
0
219
Member Avatar for sam1

learn to read, that usually helps. Don't start coding, start thinking. That helps even more though it requires you can read...

Member Avatar for sam1
0
111
Member Avatar for Young Teck 06

OEM software (and hardware) sounds cheap but it's actually illegal to sell and buy. It also usually comes without manuals and may well be a stripped down version. OEM software is licensed for distribution with specific hardware to a hardware manufacturer. Standalone distribution is strictly against the license agreement (usually …

Member Avatar for jwenting
0
125
Member Avatar for rick4324528
Member Avatar for sheereybern

hmm, sounds awfully like that other guy who spammed the forums a few weeks ago with an almost identical question. Was that guy banned or is this a classmate who found out a bit later he wouldn't get away with not doing his own homework?

Member Avatar for jwenting
0
99
Member Avatar for anderton

what is it you want to do? what is it you have done? what is it that's not going as planned? Just showing a bunch of code and pasting your assignment, then expecting someone to do all the work for you isn't going to help you. And if it's really …

Member Avatar for jwenting
-1
78
Member Avatar for TheCapn22

Are you talking the runtime or the SDK, and what OS are you working on (there are different requirements for either)? I've installed both without problems on Windows 2000, except for the SDK installer crashing once (it worked fine after I started it again).

Member Avatar for TheCapn22
0
106
Member Avatar for siddhu_avula

Since you're doing a masters in CS you'd better start learning to do your own work rather than have others do it for you. I know you're probably planning to go into management and never code again after you get your degree, instead placing impossible deadlines on us who do …

Member Avatar for jwenting
0
197
Member Avatar for freesoft_2000

You don't want the page numbers inserted into the text editor. What will happen if you add or remove text? The numbers will now no longer be properly positioned, instead showing in the middle of the pages. Instead you'd better customise your printing routine (I guess you want to print …

Member Avatar for freesoft_2000
0
91
Member Avatar for Asif_NSU

try something like [code] vector<int> v; string s; while (cin<<s) { if (s != "\n") v.push_back(atoi(s.c_str())); } [/code] replace \n with the corresponding value for your OS (or find some way to detect it and use the detected value).

Member Avatar for Asif_NSU
0
162

The End.