Forum: C++ 2 Days Ago |
| Replies: 14 Views: 491 >whch progrms u need????????
If you do this guy's homework for him, I'll be most displeased. :@
>our teacher just gave us two days...
Which is plenty of time. Stop acting like a loser and do... |
Forum: C++ 5 Days Ago |
| Replies: 7 Views: 243 >Cool, I have no idea what this does tho:
It's functionally equivalent to this:
// std::copy ( p, p + std::min ( old_n, new_n ), save );
std::size_t n = old_n < new_n ? old_n : new_n;
for (... |
Forum: C++ 5 Days Ago |
| Replies: 8 Views: 340 >there some that dont have answer which you know please do tell..
No. We'll tell you if your answers are correct or not, but we're not doing your homework for you.
>Write a brief answer to the... |
Forum: C++ 6 Days Ago |
| Replies: 7 Views: 243 >I know I'm supposed to use new and delete, but I really need to use realloc
malloc/calloc, realloc, and free don't fit well at all with objects of a class type. You really should forget they exist... |
Forum: C++ 7 Days Ago |
| Replies: 3 Views: 196 So basically you don't know how to write the program and want us to hold your hand (or do it for you). Sorry, but no go. You'll have to work a little harder than that for your code to count as proof... |
Forum: C++ 8 Days Ago |
| Replies: 3 Views: 181 >delete (particles+i);
You can only delete addresses that were returned by new. particles+i will only reference such an address if i is zero. The whole of particles can be released in a single... |
Forum: C++ 12 Days Ago |
| Replies: 5 Views: 454 >Hopefully the overhead won't be so large as to outweigh the
>advantages of compessing my data into a binary format.
In my experience it's not significantly better or worse than text conversions... |
Forum: C++ 13 Days Ago |
| Replies: 5 Views: 454 >How, without using a library written by someone else <snip> can I
>possibly write my model files on one platform, and load on another
>without either: using text files, or wasting space in my... |
Forum: C++ 15 Days Ago |
| Replies: 7 Views: 259 >I belive three, for(Iterator = something ; while-condition; do something to limit the loop ) ?
That's correct. Now take a look at your code and see if it matches what you just described. |
Forum: C++ 15 Days Ago |
| Replies: 7 Views: 259 >Lines 124 and 132 contain the same two errors.
I'll answer your question with another question: How many clauses does a for loop have?
p.s. You also need to include the <string> header. |
Forum: C++ 16 Days Ago |
| Replies: 11 Views: 461 >Because once I press ignore, check the log file, see the record
>where the problem occurred, and fix the format, then I don't have a problem anymore.
Then you're parsing the file incorrectly. The... |
Forum: C++ 18 Days Ago |
| Replies: 3 Views: 223 >1. Line #8 works (at least my compiler doesn't comply), but line #12 is not allowed. Why?
Because the types are incompatible. It's legal to add a const qualifier as such:
int *p = 0;
const int... |
Forum: C++ 19 Days Ago |
| Replies: 6 Views: 256 std::string name;
// Get the name...
std::ifstream in ( ( name + ".txt" ).c_str() ); |
Forum: C++ 20 Days Ago |
| Replies: 5 Views: 240 >Sry i was trying to quote from this answer and i accidentally gave -1 at the answer.
I fixed it for you. Now it's back at 0. :)
>Can u write the de-allocation of memory in 1 in code pls??
//... |
Forum: C++ 21 Days Ago |
| Replies: 3 Views: 176 GetData and GetSize are called on objects that are qualified as const. In such a case the compiler has to assume that both of those functions modify the state of the object, so it disallows the call.... |
Forum: C++ 21 Days Ago |
| Replies: 2 Views: 170 You want to compare with the current index, not counter. The value of counter is the number of legit values in the array. Using it as an index in an array that was not completely populated is... |
Forum: C++ 21 Days Ago |
| Replies: 7 Views: 237 The >> operator is default delimited by whitespace. If your strings need to contain whitespace, use getline instead.
FYI:
>ifstream plainText(inputPath.c_str());
>ofstream... |
Forum: C++ 22 Days Ago |
| Replies: 1 Views: 192 >Is C++ the easiest language ever?
No, it's one of the hardest.
>anybody know how to help?
Nope. Your question is about as close to incoherent as they get. Can you try to make more sense? |
Forum: C++ 23 Days Ago |
| Replies: 6 Views: 470 Mixing C++/CLI and standard C++ can be troublesome. Try sticking to one or the other unless you have good reason not to:
label2->Text = Convert::ToString ( a ); |
Forum: C++ 23 Days Ago |
| Replies: 2 Views: 343 You're working with uninitialized pointers. Pass the matrices as references:
void generate(int**&, int, int);
void fill(int**&, int, int);
int** compute(int**& ,int**&, int, int, int, int);... |
Forum: C++ 23 Days Ago |
| Replies: 9 Views: 427 >Hmm, That's very odd!
Not especially, though it can be surprising. This is the underlying problem:
#include <iostream>
#define UNICODE
#include <windows.h>
int main()
{ |
Forum: C++ 25 Days Ago |
| Replies: 5 Views: 218 >i cant drop it now ! or i'll have another semester ! cause of these 3 hours ! so no i wont drop it .
Then ! you're ! screwed ! aren't ! you? Daniweb is not a homework service. If you want to learn... |
Forum: C++ 25 Days Ago |
| Replies: 5 Views: 218 >am an engineering student and took the AI course by mistake !
So drop the course. You can do that, you know. |
Forum: C++ 27 Days Ago |
| Replies: 7 Views: 315 >I’m using dev c++ with the default gcc/g++ compiler,
>and this exact code works fine for me
There's nothing to stop a compiler from including standard headers in other standard headers. In your... |
Forum: C++ 28 Days Ago |
| Replies: 5 Views: 273 >I did not get an error using vc++ 2008 express, compiled for both C and C++ and was ok.
Visual Studio gives a warning when compiled as C because it supports this as an extension. Assuming the OP is... |
Forum: C++ 28 Days Ago |
| Replies: 2 Views: 159 Not unless you change your data structure or make certain assumptions based on the order of the array elements. But filtering one random array based on criteria from another random array, no, you're... |
Forum: C++ 28 Days Ago |
| Replies: 5 Views: 273 Please post the error and specify which compiler you're using. Also, are you compiling as C or C++? |
Forum: C++ 28 Days Ago |
| Replies: 4 Views: 440 You say you want to parse HTML, but to what end? Are you writing a browser? Something to automatically check your stocks? A spider, perhaps? The answer to that question will determine the lengths you... |
Forum: C++ 28 Days Ago |
| Replies: 7 Views: 315 Two replies (one from a mod), and both are horrid. You both completely missed the fact that the <string> header wasn't included, which means any use of the std::string try (qualified or no) will fail... |
Forum: C++ 28 Days Ago |
| Replies: 1 Views: 362 >But, don't get what it means to initialize to T()?
T() is the default constructor for the type T. |
Forum: C++ 29 Days Ago |
| Replies: 6 Views: 300 >int nulls=atoi(argv[2]);
>int arry[nulls];
Nope, sorry. C++ doesn't allow an array size that isn't a compile-time constant.
>const int nulls=atoi(argv[2]);
>int arry[nulls];
Bzzt! Wrong!... |
Forum: C++ 29 Days Ago |
| Replies: 9 Views: 345 >With that in mind generating a random character is easy:
>char randomUpperCase= 'A' + rand() % 26;
>char randomLowerCase= 'a' + rand() % 26;
Easy if you ignore the portability issue. The only... |
Forum: C++ 29 Days Ago |
| Replies: 3 Views: 348 And what was your answer? We're not here to do your homework for you.
p.s. Use code tags for code. It's not like Daniweb doesn't slap you in the face with instructions each time you post.
p.p.s.... |
Forum: C++ 29 Days Ago |
| Replies: 4 Views: 498 >So is there really nothing i can do to the findMax function to fix the problem?
No. In keeping with the spirit of the function as well as the question, the solution is to make pToMax a pointer to a... |
Forum: C++ 29 Days Ago |
| Replies: 4 Views: 498 >I cannot change the main function
Sucks for you then, because the error is in main and can't be fixed from findMax. You have an uninitialized pointer.
>pToMax = &arr[0];
>//should be
>pToMax =... |
Forum: C++ 29 Days Ago |
| Replies: 5 Views: 350 >Any good articles on methods or such to do it, any special tricks?
See my previous post for methods and tricks. Other than that, you need to have a keen understanding of how the algorithm works,... |
Forum: C++ 29 Days Ago |
| Replies: 7 Views: 343 >It seems that your function fails to check the ends of the arrays.
>Please revise your code.
That doesn't look like a compiler error. Did your teacher tell you this? |
Forum: C++ 30 Days Ago |
| Replies: 5 Views: 350 >How could I take something like that and make it recursive?
Loops are simulated using recursion, so your first step should be to take the loop and turn it into recursive calls without losing the... |
Forum: C++ 30 Days Ago |
| Replies: 11 Views: 9,171 >Might the sir be needing anything else?
For future reference, please be aware that email addresses in posts are against the rules and extremely likely to be removed by the moderators. If you quote... |
Forum: C++ 30 Days Ago |
| Replies: 4 Views: 281 No code, no help. This is obviously homework, so you need to read Daniweb's rules one more time before posting again. |