Search Results

Showing results 1 to 40 of 1000
Search took 0.55 seconds.
Search: Posts Made By: Narue ; Forum: C++ and child forums
Forum: C++ 2 Days Ago
Replies: 14
Views: 491
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Solved: hi all
Views: 196
Posted By Narue
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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
std::string name;

// Get the name...

std::ifstream in ( ( name + ".txt" ).c_str() );
Forum: C++ 20 Days Ago
Replies: 5
Views: 240
Posted By Narue
>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
Solved: a code an error
Views: 176
Posted By Narue
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
Posted By Narue
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
Solved: File
Views: 237
Posted By Narue
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
Posted By Narue
>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
Posted By Narue
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
Posted By Narue
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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
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
Posted By Narue
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
Posted By Narue
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
Posted By Narue
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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
>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
Posted By Narue
No code, no help. This is obviously homework, so you need to read Daniweb's rules one more time before posting again.
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC