6,741 Posted Topics

Member Avatar for hiddendragon

>here is code for ur problem Giving away homework answers is frowned upon here. >#include<iostream.h> We're well beyond the point where this will fail to compile on many modern compilers. I recommend you get with the times. >int array[1000000] This is a terrible waste of memory and it's also a …

Member Avatar for titaniumdecoy
0
2K
Member Avatar for moerpheus

To pack? Are you going on a trip? :icon_rolleyes: >for sure i want to knw C++ and JAVA. But i dnt knw the third! If you want to go the practical route, select a language you're likely to use. Perl and Python are both good options. If you intend to …

Member Avatar for moerpheus
0
147
Member Avatar for caismirt

>Anyone got any idea how to enable support in GCC or where is the actual problem ? What you want (to a point) is some kind of extended character set for your compiler. Unicode is widely supported by compilers these days, so for example you can already change "Hello" to …

Member Avatar for Narue
0
162
Member Avatar for kux

>template <class T> >Element* Btree<T>::recins( T& obj, Element* cpoz ) Element is a dependent type, so you need to be very specific about what it is: [code=cplusplus] template <class T> typename Btree<T>::Element* Btree<T>::recins( T& obj, Element* cpoz ) [/code] >Element *p = new Element( T ); T is a type, …

Member Avatar for ArkM
0
749
Member Avatar for cris06

Sounds like the low virtual memory notification. Kill as many unnecessary processes as you can and see if it goes away. You may need to clean up the programs that start automatically as well.

Member Avatar for cris06
0
103
Member Avatar for faisaly

>Kindly tell me in brief that " impct of OO paradigm on software development (programming)" The positive impact is that people are now (more or less) unwittingly using good design practices where those same practices were largely ignored by the masses before OO became all the rage. The negative impact …

Member Avatar for Narue
0
258
Member Avatar for cam875

[QUOTE=Ancient Dragon;651680]You formed the string incorrectly [icode]ItemFile.open((string)(ItemID+".asw").c_str());[/icode][/QUOTE] The result of operator+ for std::string is always going to be a new std::string of the same type, so your cast is redundant. This is cleaner: [code=cplusplus] ItemFile.open((ItemID + ".asw").c_str()); [/code]

Member Avatar for cam875
0
102
Member Avatar for Jennifer84

>My problem is that I am not quite sure how I have to think. Think in terms of an expression tree, just like any other expression. The only difference here is accurately handling short-circuiting on top of precedence.

Member Avatar for Jennifer84
0
333
Member Avatar for Fault

>1) im still lost on, i know the three types of loop but not >the method to discover which one to use and when. You use the loop best suited to the problem. For example, if you always execute the body of the loop at least once, a do..while loop …

Member Avatar for tecktalk
0
124
Member Avatar for fittipaldi

You're printing a pointer, of course the result will be an address. Try dereferencing brd: [code=cplusplus] cout << *brd; [/code]

Member Avatar for Narue
0
86
Member Avatar for sftwr21

>they create and initialize everything under main function as one source code program. How far into the book are you? Beginner books generally keep it simple at first and ease into full blown OO techniques. Also, don't forget that C++ is [b]not[/b] an object oriented language, it's a multi-paradigm language …

Member Avatar for Alex Edwards
0
397
Member Avatar for DS_sniper

>and take it easy on the code, I am varry new to CPP. I am at the hello world level. Since you've specified mutually exclusive requirements (relatively non-trivial tasks and code at the hello world level), I'll simply suggest you learn more C++ before trying to do this.

Member Avatar for DS_sniper
0
93
Member Avatar for bleh1318
Member Avatar for Jusa

>Should I then just remove or modify the tests, too? That makes sense. You should also modify the tests that rely on that class as well, which (depending on your level of coupling) could mean changes in other classes and other tests.

Member Avatar for Jusa
0
87
Member Avatar for R0bb0b

>Actually, I find just as many people use plain text code tags or try to specify a >language and get the syntax wrong as people who don't use code tags at all. Looking at the statistics of cases we moderators deal with on a daily basis, failure to use code …

Member Avatar for nav33n
0
147
Member Avatar for dmgcats

Well, it seems you haven't had any trouble with the process of starting a thread, so now the only problem is figuring out which forum is best suited to your question. Might I suggest one of the Windows forums that matches your version?

Member Avatar for The Dude
0
50
Member Avatar for CoolGamer48

>So, what is the difference between NULL pointers and bad pointers Null pointers have a predictable value while bad pointers do not. >why do the delete statements fail with the bad pointers? "Bad pointers" happen when you fail to initialize a pointer, manage to corrupt your memory, or try to …

Member Avatar for CoolGamer48
0
1K
Member Avatar for OmniX

>Now the idea is if b is equal to 5 then it breaks out of >the if loop, the for loop c, the for loop b, the for loop a. Nope. You can write as many breaks as you want, but only the first one will have any effect, and …

Member Avatar for Narue
0
173
Member Avatar for kv79

I wouldn't say that we've entered the realm of issuing infractions quite yet, but it's getting closer. kv79, I'd suggest you refrain from even implying that you intend to spam or engage in DoS attacks in the future.

Member Avatar for Narue
0
120
Member Avatar for brain

You've stumbled on a gray area, but the long and short of things is that what you're trying to do is illegal in standard C++, and all of the direct workarounds are also illegal. An explicit specialization needs to be in the enclosing namespace scope, which would place it outside …

Member Avatar for vijayan121
0
136
Member Avatar for preethi_ga

>C# and C#.NET are the same thing. Technically that's not true. C# is an internationally standardized language that isn't bound to the .NET framework as long as the implementation conforms to the CLI specification. The .NET framework is one such implementation. Mono is another. >can anyone please enlighten me? C# …

Member Avatar for camilojvarona
0
175
Member Avatar for sangham

[code=cplusplus] #include <iostream> #include <map> #include <string> std::string foo() { return "Foo"; } std::string bar() { return "Bar"; } int main() { std::map<std::string, std::string (*)()> m; // Map the functions to the names m["foo"] = &foo; m["bar"] = &bar; // Display all of the mapped functions std::map<std::string, std::string (*)()>::const_iterator it …

Member Avatar for ArkM
0
7K
Member Avatar for naya22

>make the int small global Yea, that's bad advice. >Globalizing variables ROX!!! You're just messing with us, aren't you?

Member Avatar for Manutebecker
0
3K
Member Avatar for scarypajamas

How about you give us some real code that compiles and gives you the error. :icon_rolleyes: It's kind of hard to tell you how your code is wrong when you summarize it using pseudocode.

Member Avatar for Narue
0
142
Member Avatar for RaDeuX

>while(fgets(pStrings, sizeof(pStrings), spIn)) That's bad on several levels. Now, I could tell you why it works, but I'd rather tell you why it's wrong. pStrings is an array of pointers to char, but fgets expects a single pointer to char. At the very least you should be passing pString[i] as …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for fmwyso

Accelerated C++ by Koenig and Moo fits all of your requirements that aren't terribly subjective or reliant on a specific implementation. I think it's a fun read, but you might not. The code is standards compliant, which means it'll work on every compiler that conforms to the standard (Visual C++ …

Member Avatar for Dave Sinkula
0
146
Member Avatar for littlestone

>but I think this solution is not efficient. Why? If you're just guessing or using your "programmer's intuition", you're probably wrong. Interviewers (good ones) tend to smile more on people who aren't afraid to say "I'd rather optimize clean, correct code than fix fast code". That's the sign of an …

Member Avatar for vijayan121
0
327
Member Avatar for ObliviousXYZ

>my prof gave me this sample program If you haven't modified it, then I would suggest you drop that professor and find another that can actually teach you C++. >Please help me.I need this by tomorrow... Please show us your attempt. If you need this by tomorrow then that means …

Member Avatar for Narue
0
134
Member Avatar for uompearl

>I want it to be infinite, if possible. Then you need to write something that can build a buffer of variable length from chunks returned by _cgets (_cgets_s in this case because you want length checking): [code=cplusplus] std::string console_read() { std::string result; char buffer[82]; std::size_t nread; while ( _cgets_s ( …

Member Avatar for Narue
0
92
Member Avatar for trowa0830

>void main() Use this as a template: [code=c] #include <stdio.h> int main ( void ) { /* Your code here */ return 0; } [/code] >clrscr(); Unnecessary, anti-social, and you forgot to include <conio.h>. >getch(); Unnecessary, non-portable (use getchar if you must), and you forgot to include <conio.h>. >but i …

Member Avatar for Aia
0
289
Member Avatar for Isonis

>we did not have the right team in place to answer customer inquiries. Translation: "We hadn't yet hired someone to troll the web looking for threads discussing our company." :icon_rolleyes:

Member Avatar for Ancient Dragon
0
224
Member Avatar for nikhil.laghave

>warning: passing arg 1 of `fread' makes pointer from integer without a cast It's generally a good idea to fix your warnings. In this case, check the documentation on fread and you'll notice that it takes a pointer to void as the first argument, not an int.

Member Avatar for nikhil.laghave
0
265
Member Avatar for nitrousjames

>wanted you to help me out with a useful link related to the subject..... Given that your original post can only be described as gibberish, the only useful link I can come up with is [url]www.google.com[/url].

Member Avatar for Salem
0
111
Member Avatar for kunalcrazycoder
Member Avatar for pdk123
Re: help

>can somebody tell me is there a problem in it ? Assuming boolean is a typedef, there's nothing syntactically or semantically wrong with that function. Perhaps if you told us what it's supposed to do, we can tell you if it actually does it.

Member Avatar for Prabakar
0
193
Member Avatar for bloody_ninja

There are two possible interpretations here: 1) Any discussion of P2P software is prohibited because the software may be used to obtain pirated software or other illegal materials. 2) The clause refers to the specific act of obtaining illegal materials using a P2P program, so discussion of legal use is …

Member Avatar for Narue
0
180
Member Avatar for Q8iEnG

>What is the situation where quadratic probing is better than chaining? Chaining takes up more memory, so if storage is tight, one of the open addressing schemes would be better suited. The time it takes to chase pointers in a chained solution might also be prohibitive, in which case an …

Member Avatar for Q8iEnG
0
117
Member Avatar for jack1234
Member Avatar for justinclev

>i wanted to make it restart the computer if the wrong passwords entered That's one of the worst ideas I've ever heard. What if other users are logged onto the system? Are you going to kill their session just because somebody fat-fingered a password? What if this program is installed …

Member Avatar for Duoas
0
106
Member Avatar for Q8iEnG

[url=http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx]Linked lists[/url]. [url=http://en.wikipedia.org/wiki/Linked_lists]More linked lists[/url].

Member Avatar for Q8iEnG
0
156
Member Avatar for virtual008

>char c; c should be an int, because that's the type that fgetc returns. Specifically, EOF may not be handled properly and certain values may overflow a char. You should also limit the scope of your variables as much as possible. I'd write it more like this: [code=c] #include <stdio.h> …

Member Avatar for ArkM
1
273
Member Avatar for TheBeast32

>I was wondering if there are any differences between the Win32 API talked about in >this book and the one that applies to Vista or anything newer than Windows 2000. I'd be surprised if there aren't. The API is constantly evolving, but the stuff covered in your book is still …

Member Avatar for TheBeast32
0
86
Member Avatar for Code Shark
Member Avatar for Ancient Dragon
0
188
Member Avatar for Alex Edwards

>I don't know enough about C++ or Java to really understand an >appropriate situation of why one would use one over the other C++ is well suited for back-end stuff, Java handles everything else. By "back-end stuff" I mean things like the JVM itself. >I just talked with an individual …

Member Avatar for sciwizeh
0
293
Member Avatar for jack1234

>May I know "Candy" is on heap or stack? Probably neither, and it doesn't matter as the compiler manages the memory for string literals. Trying to delete memory that you didn't explicitly allocate would be most unwise.

Member Avatar for ArkM
0
197
Member Avatar for anuizath2007

>Is that considered "wrong" or weird? Falling off the end of a function automatically returns, so it's weird in that people don't expect to see that kind of redundancy in well written code. It's not wrong though.

Member Avatar for anuizath2007
0
88
Member Avatar for Crushyerbones

>Is there anyway to make %s ignore whitespace? No, but you can use a scanset to get a little more control. For example, to read an entire line with fscanf you could do this: [code=c] char buffer[100]; fscanf ( file, "%99[^\n]", buffer ); [/code] However, in your case, selecting which …

Member Avatar for Crushyerbones
0
98
Member Avatar for besktrap

For starters, why are you using goto instead of a simple loop? >it goes back to the main loop and continually loops! It works for me. Please provide exact steps during execution to reproduce the problem.

Member Avatar for Narue
0
80
Member Avatar for Alex Edwards

>I am wondering how one would append additional memory >to the end of a pointer that already has memory allocated? Assuming one can't use a container class that handles memory for you, realloc doesn't have a C++ alternative, so you're stuck doing it manually. Here are the steps: 1) Allocate …

Member Avatar for Narue
0
141
Member Avatar for jayee_spicyguy

>My question is how to acess these elements Looks like an obtuse way to intialize a multidimensional array: [code=c] #include <stdio.h> #define X {{1,1,2,3,4,5,66},{3,2,4,1,5,0}} #define F {{1,2,3,4,5,6,7},{1,2,3,4,5,6}} #define I {{5,6,7,5,4,3,2},{0,9,8,7,6,5}} #define Y {X,F,I} int main ( void ) { int a[3][2][7] = Y; int i, j, m; for ( i …

Member Avatar for Ancient Dragon
0
81

The End.