Forum: C++ 5 Hours Ago |
| Replies: 1 Views: 48 Obviously you can't overload the [][] operator because no such operator exists. What you need to do for your MatrixClass class is overload the [] operator to return another type that also overloads... |
Forum: C++ 9 Hours Ago |
| Replies: 5 Views: 86 >if the char "c" lies between 48 and 57 then print it , or else ignore
Congratulations! You've introduced a completely unnecessary dependency in your program due to sheer ignorance and reduced the... |
Forum: C++ 9 Hours Ago |
| Replies: 6 Views: 183 >You can also do this: <snip conio.h crap>
You can do that...but don't teach it to others. Using conio.h is like bumping uglies with a fat chick. A lot of guys might do it, but they don't talk about... |
Forum: C++ 11 Hours Ago |
| Replies: 2 Views: 106 >pBuffer[26627664] = '\0';
You've got an off-by-one error. Do try to remember that array indexing in C is based on an offset, not an item count. pBuffer[0] is the first item, so pBuffer[N-1] is the... |
Forum: C++ 11 Hours Ago |
| Replies: 7 Views: 116 >goto /*line*/ 18;
goto is restricted to a single function, you can't jump between functions with it.
>conio.h is an older c header file and is deprecated in C++...
Please don't use deprecated... |
Forum: C++ 11 Hours Ago |
| Replies: 2 Views: 71 The names of your variables go away after compilation, so you can't query them at runtime. Instead of trying to do something magical, why not store a name in your structure and use that? Of course,... |
Forum: C++ 11 Hours Ago |
| Replies: 3 Views: 131 >then all you have to do is use a for loop, start from
>strlen(str)-1 , to >= 0 and print out at index i.
It's not that simple. Read the question more carefully. What the OP wants is word... |
Forum: C++ 12 Hours Ago |
| Replies: 6 Views: 146 >If you can post your complete code in here
That is the complete code, genius. |
Forum: C++ 12 Hours Ago |
| Replies: 1 Views: 73 >what is the difference between these two ?
The only difference is in the details. Assuming your "factory design implementation" is some other variant of the factory pattern from a factory function,... |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 105 >Set UserInfo = LastName = “ , “ + Birthdate
My brain has trouble parsing this line. Perhaps you meant:
Set UserInfo = LastName + “ , “ + Birthdate |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 100 No, that won't work. To use the zero-argument manipulator syntax, the manipulator has to be either a static member function, or a non-member function. non-static member functions aren't compatible... |
Forum: C++ 1 Day Ago |
| Replies: 6 Views: 146 >pointer-type variables hold memory addresses..
>just like int's hold integers, char's hold ascii values etc.
Yay! Finally people are starting to get it.
>here is one way to "get the vowels to... |
Forum: C++ 1 Day Ago |
| Replies: 5 Views: 172 >I understand for quick solutions you would follow AncientDragon's sage advice.
Actually, AD's advice is ideal:
Student: "How do I use printf with templates in C++?"
Teacher: "Don't use printf."... |
Forum: C++ 1 Day Ago |
| Replies: 1 Views: 92 >so, please can anyone help me with this?
Start by writing something, so we know you're actually engaging your brain and trying to learn rather than looking for freebies. |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 100 Typically you pass in any object derived from istream or ostream (such as cin, cout, any fstream object, any stringstream object, etc...). Equally typically, the return value is used to get the... |
Forum: C++ 1 Day Ago |
| Replies: 6 Views: 146 >I'm not sure how to get the vowels to show up in Case A.
The problem isn't the pointer, it's the fact that you're returning a pointer to a local array. When the function returns, the memory for... |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 125 >I have everything initialized everywhere, or at least since i checked last time.
Then your problem is with the math, or you're overflowing an array somewhere and ultimately using... |
Forum: C++ 1 Day Ago |
| Replies: 1 Views: 95 Do you know how to divide two polynomials on paper? If not, figuring it out before writing a character of code strikes me as the proper first step. You can't write code to do something you don't know... |
Forum: C++ 1 Day Ago |
| Replies: 7 Views: 134 Your polynomial class has a pointer member and a destructor, but no user-defined copy constructor. Sounds like a one-way ticket to the exact error you're describing. |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 125 You miscopied the implementation, it's just a duplicate of the header, so I can't make any comments on your error except speculation.
>Why am i getting negative numbers and why is the iterations... |
Forum: C++ 1 Day Ago |
| Replies: 4 Views: 120 >So the iostream allows for keyboard input
At the risk of giving you too much information, there are several stages that your code goes through from source to executable. Here are the stages (bird's... |
Forum: DaniWeb Community Feedback 3 Days Ago |
| Replies: 6 Views: 229 Being busy and lack of interest conspire to keep me away. Rest assured, when(if) I return full force, you can look forward to old school Narue replies. |
Forum: Legacy and Other Languages 3 Days Ago |
| Replies: 3 Views: 157 Sculpting, flower arrangement, ballet, and firework pyrotechnics. I would like to know the difference between these listed. |
Forum: DaniWeb Community Feedback 5 Days Ago |
| Replies: 37 Views: 3,139 >why would you bad mounth someone for asking a questions.
Can you be any more melodramatic, Mr. Drama Queen? As much as goody goodies like you want the world to run on sunshine and fairy dust,... |
Forum: C++ 8 Days Ago |
| Replies: 3 Views: 180 There's nothing wrong with it per se, but it's generally wiser not to confuse your readers with frivolous includes that aren't used in the file. |
Forum: DaniWeb Community Feedback 11 Days Ago |
| Replies: 16 Views: 913 Um, you fail. This isn't a bug, it's documented behavior (http://www.daniweb.com/forums/misc-explaincode.html) that's been in place for years. You may as well just call it what it is: changing basic... |
Forum: C 12 Days Ago |
| Replies: 16 Views: 485 >I don't really see your point....
That much is obvious.
>Is your point that is not 100% the standard?
My point is that it could potentially be the cause of your problem because a compiler is... |
Forum: DaniWeb Community Feedback 12 Days Ago |
| Replies: 16 Views: 913 >However, using code tags for something outside of code to achieve
>a visual effect as a result of the current way code tags happen to be
>handled cannot ever be guaranteed in the future.... |
Forum: C 12 Days Ago |
| Replies: 16 Views: 485 >Maybe I'm having problems with this statement
>"the result shall compare equal to the original pointer"
It means that you can convert an object pointer to or from a void pointer without any loss... |
Forum: C 12 Days Ago |
| Replies: 16 Views: 485 >Could you give an example....
Your code is an example, my fix for your code is a counter-example. What more do you want? How about a quote from the standard:
The key terms here are incomplete... |
Forum: C 12 Days Ago |
| Replies: 16 Views: 485 >No the complier had no problems casting a void pointer to a function..should it?
It might. Technically void* and functions pointers are incompatible and converting between them is undefined... |
Forum: C 12 Days Ago |
| Replies: 5 Views: 203 C doesn't specify tab stops, only tab characters. It's up to the program consuming those characters to interpret the character with a certain tab stop length, just like it's up to the same program to... |
Forum: Geeks' Lounge 13 Days Ago |
| Replies: 20 Views: 1,084 Methinks this poll is biased. You're missing a few moderators, including our illustrious super mod... |
Forum: C++ 13 Days Ago |
| Replies: 7 Views: 296 That's not what I would call "very difficult". You're also not likely to get any help by posting a homework assignment with no proof of effort. Show us that you tried to solve the problem first. |
Forum: C++ 13 Days Ago |
| Replies: 3 Views: 300 You can move the position (using seekg) either by an offset, or to a previous point (that was saved by tellg). Unless your file is very strictly formatted, you probably want the latter. So in your... |
Forum: C++ 13 Days Ago |
| Replies: 5 Views: 249 >//doesnt work to my knowledge
>int average(ifstream& file_in);
The parameters and return type are not dependent. If that prototype doesn't work, it's because you did something else wrong. How... |
Forum: C++ 13 Days Ago |
| Replies: 2 Views: 179 The capacity of a container class has nothing to do with the OS, it's an internal mechanism of the C++ implementation. In other words, capacity will potentially return a different value for every... |
Forum: C++ 13 Days Ago |
| Replies: 9 Views: 265 >so tell me when u ll start to learn me ???????? i m wating
I'll learn you good. Start by not being so impatient. Everyone has to start from nothing and work their way up to something. Being given... |
Forum: C 16 Days Ago |
| Replies: 5 Views: 206 >i spent lot of time in googling but couldnot get it.
Hmm, perhaps that's because it's copyrighted and any free PDF you find is illegal? If you want the book that badly, go buy it. If you can't... |
Forum: C 16 Days Ago |
| Replies: 1 Views: 180 >Please help me find the mistake!
I suspect the mistake is a complete failure to study whatever book on C you have. Instead of trying to finish this exercise in one swell foop, perhaps you should be... |