6,741 Posted Topics

Member Avatar for Google Spider

>What about the second '\n'? It doesn't exist. That loop is designed for line-oriented interactive input from stdin. Because a newline is expected to terminate the buffering mechanism for your shell, there will only ever be one newline, and that newline will mark the end of the buffer. As such, …

Member Avatar for Narue
0
129
Member Avatar for tefflox

At the risk of driving the thread even further off course, I'd like to address some of the issues raised concerning the moderators. >For the very first post I made, a moderator insulted me by saying this is a "professional" >forum and that I should capitalize sentences and use proper …

Member Avatar for Narue
-1
312
Member Avatar for somita1

First, stop abbreviating like that. It's unconventional and will easily confuse people. Second, how in the world do you expect us to know what you're talking about when you don't even define your acronym? XDE isn't a common an unambiguous one to the best of my knowledge. :icon_rolleyes:

Member Avatar for Joolz
0
162
Member Avatar for mattyd

>could this then prove the non existence of god? It's logically impossible to prove that something [B]doesn't[/B] exist for any reasonably complex system, and the universe is somewhat complex.

Member Avatar for ~s.o.s~
3
10K
Member Avatar for David S Cherry

I don't write games, so I can't help. But I do have a question. If you're a web designer, why would your company ask you to help write a game application?

Member Avatar for CoolGamer48
0
115
Member Avatar for CodeBoy101

>As in selecting which line to start from.? Sure, but unless the file is structured enough to seek, you'll have to actually read your way to the correct line. Writing is harder if you mean to insert rather than overwrite. In that case you need to save the subsequent lines …

Member Avatar for CodeBoy101
0
144
Member Avatar for jireh

>Note: Don't use a try catch Erm, why? On Error is generally considered to be a huge wart of VB, so why would you want to avoid the superior equivalent in C# and try to emulate it?

Member Avatar for jireh
0
733
Member Avatar for dreamz4u

Moved. >able to handle adobe photoshop and not slow down when u do other things Photoshop is a resource hog. Keep that in mind. If you're going to be running Vista and Photoshop, I'd recommend at least 2GB of RAM. >Have a webcam and burn cds with lightscribe... You can …

Member Avatar for Narue
0
106
Member Avatar for Little Princess

We have an active forum devoted to C. I'd wager that one or two of us know it. Can you be more specific about "how C can be made"? Do you mean how to compile C source? How to write a compiler?

Member Avatar for oi2005
0
107
Member Avatar for fatasscp
Member Avatar for sacdpathade
0
113
Member Avatar for legendofme

While I'm pleased that you diligently use code tags, please keep in mind that "icode" and "code" are two different tags that aren't designed for the same purpose. "code" tags should be used for blocks of code that are separate from the text of a post. [code] Code tags are …

Member Avatar for Narue
0
95
Member Avatar for Majestics

How about you describe what you're trying to do? What you're asking for is somewhat nonsensical out of context.

Member Avatar for sacdpathade
0
91
Member Avatar for khaled_nagaty

The text box control only recognizes the system newline, not the language newline, which could be different. Typically '\n' isn't actually multiple characters if the system uses something like CRLF. Instead, whenever '\n' is sent back to the system (through file I/O for example), it's expanded into CRLF. Jx_Man gave …

Member Avatar for Jx_Man
0
147
Member Avatar for briansmall
Member Avatar for ZZucker
0
560
Member Avatar for El Duke

>And what if string.h is not allowed to be used !!!! Most of the functions in string.h are simple to implement. If you can't use the standard library, it's not a great effort to roll your own string handling functions.

Member Avatar for El Duke
0
541
Member Avatar for macrosoft

>iostream or iostream.h??? iostream. iostream.h isn't a valid C++ header anymore. >it's like I'm not using a C++ compiler Maybe you aren't. The file extension usually tells your compiler what language specification to use. If the file is a .c file then you're probably compiling as C, if it's a …

Member Avatar for togayot
0
452
Member Avatar for Black Magic

>wanted to know if it could be done If you find yourself asking if "<insert something here> can be done in C++", just go ahead and assume the answer is yes. It probably is. >Could you please show me how this could be achieved thanks. How about I tell you …

Member Avatar for Narue
0
3K
Member Avatar for emilio
Member Avatar for En1ro
Member Avatar for mitrmkar
0
591
Member Avatar for DigitalPackrat

My my, such an easy game. >1. replyfast-c++ Gimme code. >2. how do I? Gimme solutions. >3. Help on java Gimme code. >4. java game code Gimme code. >What I am trying to say here is can't people >read the forum guidelines before posting. No. They don't care, so why …

Member Avatar for DigitalPackrat
0
133
Member Avatar for Lotus_2011

When you make a conversion like that, you get the digits in reverse. There are a number of ways to swap the order. First you have recursion: [code=cplusplus] #include <iostream> #include <ostream> void to_octal ( std::ostream& out, int value, int n = 0 ) { if ( value == 0 …

Member Avatar for Narue
0
89
Member Avatar for knight fyre
Member Avatar for Infarction
0
157
Member Avatar for atn

>So, store the username and password in a file (encrypted I hope), >and on startup, if the file exists, load up the information. Ugh, no. Even encrypted, don't copy the password anywhere, period. Ideally you wouldn't even store it for authentication, instead favoring an irreversible hash[1]. The only place a …

Member Avatar for Narue
0
157
Member Avatar for henpecked1

>How do I prevent the user from entering characters when a float is required? There's no standard way to stop a user from entering a character. You'd have to use a non-portable solution or allow anything under the sun and provide robust validation. I always recommend going for the portable …

Member Avatar for henpecked1
0
141
Member Avatar for venumadhavkk
Member Avatar for Narue
0
203
Member Avatar for GrimJack

>What the heck is going on?! Some of us change avatars regularly. It's an easy way to personalize your posts.

Member Avatar for majestic0110
0
312
Member Avatar for Project_Panda

>Would I attach pragma once here as well? I don't see why you would need to unless you actually include register.cpp in another file. Otherwise, it'll work without the #pragma because implementation files must only have one instance in the translation unit or you'll get multiple definition errors. #pragma once …

Member Avatar for Narue
0
177
Member Avatar for Agni

Note that there's a point at which it's a bad idea to change your name. When joey did it recently, it threw all of us off, and I'm still not used to calling him John A. :icon_rolleyes:

Member Avatar for William Hemsworth
0
331
Member Avatar for littlestone

>if the constructor of ClassTest throw exception, what will happen? Why don't you try it and see? >will ptr == 0 ? That's a good assumption. >some memory leak? It depends on what throws the exception and how you deal with it. If your constructor allocates memory but doesn't release …

Member Avatar for Narue
0
168
Member Avatar for mghx

Generating random numbers is a common question here. Try searching the forum.

Member Avatar for Narue
0
244
Member Avatar for freakinsweet865

That's...random. I suppose you're using your first post to show off your m4d pr0gr4mm1ing sk1llz. :icon_rolleyes:

Member Avatar for Ancient Dragon
0
99
Member Avatar for zandiago

>I learn what I need to know from the people around me. How is that any different? You're still learning things as another person or persons choose to present them to you. You might feel morally superior, but the end result is likely going to be the same. If you …

Member Avatar for jbennet
0
862
Member Avatar for tones1986

Template tip #1: Write your class first using concrete types (such as int) and get it working. Then add the template parameters and replace instances of the concrete types with the parameters. This skips the whole "a template isn't instantiated until you use it" crap, which tends to hide simple …

Member Avatar for Lerner
0
148
Member Avatar for silvergirl

>while ((score = sr.ReadLine()) != null) ReadLine returns a string, not a double. There's no implicit conversion from string to double, so you have to make the conversion manually: [code=csharp] string line; while ( ( line = sr.ReadLine() ) != null ) { double score = double.Parse ( line ); …

Member Avatar for JerryShaw
0
227
Member Avatar for TriTz

>How can I use templates with generic data nodes? Store polymorphic objects or pointers to void.

Member Avatar for Narue
0
190
Member Avatar for CodeBoy101

The location of the executable isn't required to be in the current working directory. What OS and compiler are you using?

Member Avatar for CodeBoy101
0
337
Member Avatar for echoestroy

The simplest method is to break when randomNumber is one of those values: [code=cplusplus] if ( randomNumber == 5 ) break; [/code] That gets a little tedious when the list of numbers to break on is long, but you can easily scale it up with a collection: [code=cplusplus] #include <cstdlib> …

Member Avatar for echoestroy
0
142
Member Avatar for spuddy1515

What kind of manipulation are you looking for? Standard C++ pretty much only gives you query capabilities for the clock, though you have comprehensive time and date control.

Member Avatar for spuddy1515
0
526
Member Avatar for techbound

The majority of posters aren't interested in being a part of the community. They have a question and bail as soon as it's answered or as soon as it's clear they won't get a "satisfactory" answer.

Member Avatar for Salem
0
195
Member Avatar for VernonDozier

>Shoot the Iraqis carrying Evian bottles because [Evian] is manufactured in France. Haha. >Wait until evening prayers, then bomb the mosque. Bwahaha! I got 11 out of 19, probably because I focused too much on preserving potentially innocent lives. :icon_rolleyes:

Member Avatar for majestic0110
0
143
Member Avatar for mjzammit

>"<img.*src\\s*=\\s*(?:\"(?<1>[^\"]*)\"|(?<1\\S+))" but it doesnt work Erm, why not just this? [code=csharp] private HasAttribute ( string src, string tag, string attribute ) { string query = "<" + tag + ".+" + attribute + ".+>"; //... } [/code] All you're doing is checking a specific tag to see if it has …

Member Avatar for mjzammit
0
125
Member Avatar for zykostar

Finding examples of the regular expression library in C# is easy, so I'll leave that to you. The regular expression you want might be something like this: [code=csharp] ">\s*\d+\s*<" [/code] What this does is look for any number with one or more digits (+\d), surrounded by > on the left …

Member Avatar for zykostar
0
285
Member Avatar for sjgriffiths

If you know the string is big enough to hold all of the extra characters, it's a relatively simple matter of finding instances of "LTD", shifting everything after the matched substring (to make room), and copying the new substring in: [code=c] #include <stdio.h> #include <string.h> int main ( void ) …

Member Avatar for Narue
0
66
Member Avatar for gehad3003

>Should the implementation be based on front and >rear and just change the value of front and rear. Yes. When you add an item (stack as the example), add to the rear and increment it. If incrementing it would put it beyond the last element, reset it to 0. When …

Member Avatar for gehad3003
0
184
Member Avatar for bodhankaryogesh

FYI: It's somewhat difficult to pinpoint syntax errors when we can't see the code. So post the code.

Member Avatar for Narue
0
103
Member Avatar for >shadow<

God, does your ego really need so much stroking that you would lie to keep your bogus Wikipedia article alive?

Member Avatar for jwenting
0
59
Member Avatar for komany

>Is there somewhat better way to type the code below? Are you simply asking for advice on working code, or are you having problems with it? I can see areas where mixing and matching types (both ranges and signedness) may get you in trouble. If all you want is ways …

Member Avatar for Ancient Dragon
0
166
Member Avatar for flash121

>The method has to be declared using a template. Why? What does this method do? Can you post your code?

Member Avatar for Narue
0
113
Member Avatar for chrisfrolich

What have you tried so far? Have you worked out the tasks that need to be performed?

Member Avatar for Narue
0
51
Member Avatar for Drake

>why do programmers benifit from having such a variety? They can choose the data type that best fits the problem and optimize speed or storage costs. >Also if anyone could help me out with what an unsigned character is used for? Off the top of my head: If you don't …

Member Avatar for Narue
0
93

The End.