Search Results

Showing results 1 to 40 of 1000
Search took 0.12 seconds.
Search: Posts Made By: Narue
Forum: C++ 1 Day Ago
Replies: 5
Views: 146
Posted By Narue
>Why is this producing an error?
Stream objects aren't copyable at the object level. As jonsca said, you need to pass a reference to the ifstream.
Forum: C++ 1 Day Ago
Replies: 4
Solved: functions
Views: 153
Posted By Narue
>would you happen to know any good example on how to thread?
Proper multi-threading is non-trivial, so you're not likely to find one example that will teach you what you need. My recommendation...
Forum: C++ 1 Day Ago
Replies: 4
Solved: functions
Views: 153
Posted By Narue
Check the class of whatever aPort is to see if it has a non-blocking read, or some way to query the port for incoming data. If not, you might want to look into spawning a separate process or thread...
Forum: C++ 2 Days Ago
Replies: 8
Solved: return question
Views: 241
Posted By Narue
>I've seen a few odd programs (emphasis on the odd)
>that actually use the bool return type for main...
Once again, it's a requirement that main return the int type. bool main() is just as wrong...
Forum: C++ 2 Days Ago
Replies: 5
Views: 205
Posted By Narue
>is this possible?
Is this a troll? Or a bad joke? Of course it's possible, as are most things that noobs use the "is it possible?" question to ask about.
Forum: C++ 2 Days Ago
Replies: 8
Solved: return question
Views: 241
Posted By Narue
>In most, if not all OSes; if a program's main function returns an int, 0
>indicates that program execution ended normally.
>Any other value indicates that the program execution ended ...
Forum: C++ 2 Days Ago
Replies: 3
Solved: Random in Class
Views: 155
Posted By Narue
>I've tried stuff like srand(time) in main, however, that doesn't apply to the class
And if you do it in, say, the constructor, what do you expect will happen when you create two objects of that...
Forum: C++ 2 Days Ago
Replies: 3
Solved: hi all
Views: 162
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 3 Days Ago
Replies: 10
Views: 307
Posted By Narue
>I'm not arguing with you but global variables must be an accepted misconception..
It's well understood terminology, and everyone knows well enough what you mean when you say "global variable", so...
Forum: C 3 Days Ago
Replies: 10
Views: 307
Posted By Narue
>In my case, I obtain errors (undefined reference to `myVar') when I use extern in "global.h."
Are you forgetting the definition? I added a globals.c file that forces an absolute definition for...
Forum: C 4 Days Ago
Replies: 10
Views: 307
Posted By Narue
>I've read that global variables should be defined once and declared
>in evry file using those variables using the keyword extern?
Yes, that's a safe guideline. I'd do it like the following...
Forum: C++ 9 Days Ago
Replies: 5
Views: 384
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 11 Days Ago
Replies: 7
Views: 300
Posted By Narue
>I was thinking stdin
The stream in question is whatever input stream you want to clean up in a line-oriented fashion, but yes, it was written with stdin in mind.

>Will it be something like this...
Forum: C++ 11 Days Ago
Replies: 7
Views: 230
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++ 11 Days Ago
Replies: 7
Views: 230
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++ 12 Days Ago
Replies: 6
Views: 243
Posted By Narue
You can specialize myclass::function based on the template parameters of myclass:

#include <iostream>

struct mystruct {};

template <class T>
class myclass
{
public:
Forum: C 12 Days Ago
Replies: 7
Views: 300
Posted By Narue
>So, in a nutshell, I'm looking for an alternate of the non-standard getch();
Unfortunately, you can't do it in one line without making some assumptions or rolling the whole thing up into a...
Forum: C++ 12 Days Ago
Replies: 11
Views: 433
Posted By Narue
>Narue, WHY are you ranting about it?
Because I'm trying to help you, and I think ranting is the only way you'll pay attention. You should be flattered. Normally, I wouldn't bother replying to...
Forum: C++ 12 Days Ago
Replies: 2
Solved: Vectors
Views: 202
Posted By Narue
Did you check your handy C++ library reference? Because it's all explained there, and a more specific question than "can you tell me everything I want to know?" is likely to encourage high quality...
Forum: C++ 12 Days Ago
Replies: 11
Views: 433
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++ 12 Days Ago
Replies: 11
Views: 433
Posted By Narue
>No see it's ok if it's ignored.
No, see it's not. A debug assertion doesn't mean you hit an expected runtime error condition, and it doesn't mean that your files aren't formatted the way your...
Forum: C++ 12 Days Ago
Replies: 11
Views: 433
Posted By Narue
>is there a way to make it ignore automatically? Without the message box appearing?
Yes, fix the error that causes the message in the first place. Silencing an error doesn't make the error go away,...
Forum: C++ 14 Days Ago
Replies: 3
Views: 200
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 14 Days Ago
Replies: 20
Views: 779
Posted By Narue
>I only posted because I agreed with the OP about our instructor.
>Then you proceed to call me a sock puppet...
Exactly. I call it like I see it, and if you have a problem with that, you're...
Forum: C 14 Days Ago
Replies: 20
Views: 779
Posted By Narue
>Why even bother posting when someone is asking for help, you have a very poor attitude.
Pardon? You must have missed the fact that I was the first person to help Mattpd in this thread. You must...
Forum: C 14 Days Ago
Replies: 20
Views: 779
Posted By Narue
>I can vouch for this guy
Yea, that's not suspicious at all. :icon_rolleyes: From past experience, I'm more inclined to believe that you're a sock puppet rather than a concerned classmate.
Forum: C++ 15 Days Ago
Replies: 6
Views: 233
Posted By Narue
>I am using Visual C++
More specifically, it looks like you're using C++/CLI. I don't recommend mixing standard C++ libraries (such as ifstream) and .NET libraries (like System::String). It's more...
Forum: C++ 15 Days Ago
Replies: 6
Views: 233
Posted By Narue
std::string name;

// Get the name...

std::ifstream in ( ( name + ".txt" ).c_str() );
Forum: C++ 15 Days Ago
Replies: 3
Views: 245
Posted By Narue
I can't do anything about your eyesight. But it does show an example of how to define the function under the heading "Compound Assignment Operators += -= *=".
Forum: C++ 15 Days Ago
Replies: 3
Views: 245
Posted By Narue
>I cannot find on the web.
You didn't look very hard, did you? This (http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html) is the first hit from google that I got using keywords...
Forum: C++ 15 Days Ago
Replies: 6
Views: 257
Posted By Narue
I can't tell you where your problem is. I'm not quite that psychic. But I can tell you that if you have a custom allocator on m_argument, it's very possible that a bug in the allocator is leaking...
Forum: C++ 15 Days Ago
Replies: 6
Views: 257
Posted By Narue
>at this point of time i'm not sure on your question
So are we talking about a codebase that's a team effort or otherwise isn't written entirely by you?
Forum: C++ 15 Days Ago
Replies: 6
Views: 257
Posted By Narue
>Below is the block of code for your reference.
Are you using a custom allocator?
Forum: C++ 15 Days Ago
Replies: 5
Views: 233
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 16 Days Ago
Replies: 5
Solved: File appending
Views: 406
Posted By Narue
>Kindly let me know of alternatives of how I could solve this problem.
You're not actually appending to the file, you're appending to lines in the file, which amounts to inserting into the file....
Forum: C++ 16 Days Ago
Replies: 10
Views: 517
Posted By Narue
Dude, your code is severely broken in several ways. I can only assume that MyFunction is equally crappy. Start by normalizing your expected/actual types, and fix your overflow errors. I'd help you...
Forum: C++ 16 Days Ago
Replies: 10
Views: 517
Posted By Narue
MyChar is an array of char. a[i] is a single char. The two types are completely incompatible. MyChar[i] = a[i] would work. At least until i gets incremented past 1, then you're accessing a out of...
Forum: C++ 17 Days Ago
Replies: 3
Solved: a code an error
Views: 168
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 17 Days Ago
Replies: 20
Views: 779
Posted By Narue
>I am not certain where to start.
Then you should consider switching your major. "I don't know where to start" is equivalent to "I'm not cut out for programming".

>1. Write a C program that only...
Forum: C++ 17 Days Ago
Replies: 7
Solved: File
Views: 232
Posted By Narue
>First you did not change the while as narue said
>while ( getline ( plainText, plainLine ) ) {
>instead of
>while (getline(plainText, plainLine)){
Um...what? Do you really think a few extra...
Showing results 1 to 40 of 1000

 


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

©2003 - 2009 DaniWeb® LLC