Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 67
Search took 0.03 seconds.
Search: Posts Made By: Twilight
Forum: C++ Apr 23rd, 2007, 2:11 AM
Replies: 1
Views: 126
Posted By Twilight
Well, I don't know how all the machinery works...

Well, I don't know how all the machinery works with the code, but the basic idea is pretty simple.

One station sends out a packet, and records the exact time it was sent at. The other machine...
Forum: C++ Apr 20th, 2007, 9:33 PM
Replies: 23
Views: 501
Posted By Twilight
Well, I've read through the thread, and many...

Well, I've read through the thread, and many others. I think I'm just missing something simple. When I tried the common version I found around the internet, it looks basically like this:


...
Forum: C++ Apr 20th, 2007, 4:53 PM
Replies: 23
Views: 501
Posted By Twilight
But there wasn't anything past that. At the...

But there wasn't anything past that. At the previous prompt it would be a single digit input, and a newline.
Forum: C++ Apr 20th, 2007, 3:04 AM
Replies: 23
Views: 501
Posted By Twilight
While we're on the topic of input pauses, maybe...

While we're on the topic of input pauses, maybe you could explain something to me DaWei.

I was trying to make a little portable version of system("Pause") I could just toss in where I needed it. ...
Forum: C++ Apr 14th, 2007, 4:47 PM
Replies: 14
Views: 307
Posted By Twilight
What is the problem with Goto statements? I've...

What is the problem with Goto statements? I've dabbled in a little assembly code, where gotos are your bread and butter. Is it just considered terrible form to use them in higher languages?
Forum: C++ Apr 12th, 2007, 10:18 AM
Replies: 5
Views: 166
Posted By Twilight
We have a generic Matrix class provided by our...

We have a generic Matrix class provided by our department that works pretty well. The only thing it was really missing we added ourselves.

Heres the prototypes if you wanna see what kind of stuff...
Forum: C++ Aug 7th, 2006, 10:32 PM
Replies: 5
Views: 181
Posted By Twilight
The parameter is used plenty Dark, it's just that...

The parameter is used plenty Dark, it's just that the compiler doesn't care about the name of the variable at that point. You can write:

LRESULT MainDialog::OnInitDialog(UINT, WPARAM ,LPARAM,...
Forum: C++ Jul 20th, 2006, 2:00 AM
Replies: 15
Views: 298
Posted By Twilight
The special ones I can think of offhand are...

The special ones I can think of offhand are Binary Trees and Balanced Trees, but there really are about as many tree types as you count.
Forum: C++ Jul 1st, 2006, 3:04 PM
Replies: 16
Views: 422
Posted By Twilight
No, like when your new car explodes during a...

No, like when your new car explodes during a crash test. It's obvious, and because you bothered to test the thing, you're probably better off for it. Most of the time it's just a stupid mistake you...
Forum: C++ Jun 30th, 2006, 11:54 PM
Replies: 16
Views: 422
Posted By Twilight
But junk output isn't dangerous, just because...

But junk output isn't dangerous, just because you'll notice it right off the bat.
Forum: C++ Jun 23rd, 2006, 3:41 PM
Replies: 21
Views: 458
Posted By Twilight
They are two separate libraries IIRC, both for...

They are two separate libraries IIRC, both for storing strings, but done in different ways.
Forum: C++ Jun 21st, 2006, 10:21 PM
Replies: 21
Views: 458
Posted By Twilight
Well, if the book didn't have the line "using...

Well, if the book didn't have the line "using namespace std;", it should declared all its strings as follows


std::string someString = "some nonsense";


I don't know anything about namespaces, but...
Forum: C++ Jun 20th, 2006, 10:01 PM
Replies: 21
Views: 458
Posted By Twilight
Your friend is right. Usually the programming is...

Your friend is right. Usually the programming is not the most difficult part, the math is. Implementing the matmematical algorithms can be tough at times. My linear algebra class was mostly on...
Forum: C++ Jun 12th, 2006, 1:35 AM
Replies: 2
Views: 165
Posted By Twilight
Before you even think about finding the inverse...

Before you even think about finding the inverse in C++, you need to know how to do it mathematically. If you understand that, it shouldn't be too tough. In fact, what you need is not a matrix...
Forum: C++ Jun 6th, 2006, 9:14 PM
Replies: 5
Views: 209
Posted By Twilight
Thanks for the code example, right now I don't...

Thanks for the code example, right now I don't really understand whats happening, but I do have "C++ From the Beginning" by Jan Skansholm from my first year programming course, which has 3 chapters...
Forum: C++ Jun 5th, 2006, 12:12 AM
Replies: 5
Views: 209
Posted By Twilight
Learning New OOP Concepts

I've done a fair share of programming over the last couple of years, but I was wondering if anyone had any exercises dealing with Inheritance or Polymorphism to help me learn the concepts. Old Uni...
Forum: C++ Jun 2nd, 2006, 1:25 PM
Replies: 3
Views: 168
Posted By Twilight
When I ran your code, the cout worked fine. And...

When I ran your code, the cout worked fine.

And your code as of now works backwards. It just thinks primes are not primes, and vise versa.
Forum: C++ May 29th, 2006, 4:00 PM
Replies: 32
Views: 1,052
Posted By Twilight
Could somebody post code for/explain how a C++...

Could somebody post code for/explain how a C++ Sudoku solver would work? I've always been kinda curious, since I started wasting so much time playing that game.
Forum: C++ May 26th, 2006, 8:02 PM
Replies: 28
Views: 837
Posted By Twilight
Yeah, a loop is the way to go. And look into the...

Yeah, a loop is the way to go. And look into the standard, built in List library. It'll save you some time, and you won't have to worry about stuff going wrong with your list coding.
Forum: C++ May 23rd, 2006, 3:05 PM
Replies: 28
Views: 837
Posted By Twilight
The menu was the easiest part. I just had...

The menu was the easiest part. I just had something like the following:



std::list<Employee*> employees;

int main()
{
string choice;
while(1)
Forum: C++ May 23rd, 2006, 2:57 AM
Replies: 28
Views: 837
Posted By Twilight
Yeah, use lists. The whole thing is actually...

Yeah, use lists. The whole thing is actually fairly simple. I decided to do it on a whim, used a list and strings, the whole thing took about an hour of mostly copying and pasting.
Forum: C++ May 23rd, 2006, 1:14 AM
Replies: 28
Views: 837
Posted By Twilight
Yeah, what Uman wrote is pretty much how you'll...

Yeah, what Uman wrote is pretty much how you'll do it. Then all main needs is a simple loop to output all the employees in your list.
Forum: C++ May 22nd, 2006, 9:22 PM
Replies: 28
Views: 837
Posted By Twilight
Why exactly, would you need to have the size of...

Why exactly, would you need to have the size of the array for a copy operation? That said:


int size = 0;
int i = 0;

while( CharArray[i] = '\0')
{
size++;
i++;
Forum: C++ May 22nd, 2006, 8:20 PM
Replies: 28
Views: 837
Posted By Twilight
char* getFName() { return &fName // or...

char* getFName()
{
return &fName // or &fName[0] if that makes more sense, same thing
}

//Then, in your main function

{
. . . .
char* TheName = getfName();
Forum: C++ May 19th, 2006, 1:30 AM
Replies: 3
Views: 143
Posted By Twilight
Do you really need Emacs? If all you need is...

Do you really need Emacs?

If all you need is an IDE and Compiler, get Dev C++. I've used it for 2 years now for University programs, where the campus uses Linux and Emacs/XEmacs.
Forum: C++ May 18th, 2006, 1:12 PM
Replies: 4
Views: 191
Posted By Twilight
Basic File Search Program

I was wondering it, given a windows directory, there is a function to read all the names of files in that directory. Essentially what I want to do is have a program search for strings within file...
Forum: C++ May 18th, 2006, 4:43 AM
Replies: 19
Views: 382
Posted By Twilight
You might want to take a look at your menu...

You might want to take a look at your menu function though. From what I gather, it appears to be recursive, which makes no sense, and could really hurt you.

Try making menu() return an int, and in...
Forum: C++ May 16th, 2006, 4:44 AM
Replies: 2
Views: 127
Posted By Twilight
Yeah, if you put "\t\t" you will get Name1 ...

Yeah, if you put "\t\t" you will get

Name1 Name2

And I'd make your number of hours doubles, as it is possible to work for half an hour ;)
Forum: C++ May 15th, 2006, 12:20 AM
Replies: 6
Views: 250
Posted By Twilight
And unless I missed something, it seems like it's...

And unless I missed something, it seems like it's going to infinite loop as well. Since your counter must be greater than 1, but only ever gets incremented, you may have some issues there, and that...
Forum: C++ May 12th, 2006, 2:12 PM
Replies: 12
Views: 362
Posted By Twilight
A Windows and Linux system will only deallocate...

A Windows and Linux system will only deallocate static memory. If you create by doing this

variable something = new something


then the operating system will not delete it. When an OS deallocates...
Forum: C++ May 12th, 2006, 1:42 AM
Replies: 13
Views: 355
Posted By Twilight
Yeah, I once tried to debug someones code for...

Yeah, I once tried to debug someones code for like half an hour, with errors all over the place. I was rather new to C++ at the time, and it took me a while to notice she had forgotten an opening...
Forum: C++ May 8th, 2006, 3:51 AM
Replies: 13
Views: 401
Posted By Twilight
Yeah, but when you actually write the class code,...

Yeah, but when you actually write the class code, you just define the operator. Since the operator itself it just something performed on a class, the this pointer should still work.
Forum: C++ May 8th, 2006, 3:47 AM
Replies: 41
Views: 841
Posted By Twilight
Yeah, I only use really short variable names for...

Yeah, I only use really short variable names for loops and in very small functions. Otherwise it's just too wierd to have someone look at.
Forum: C++ May 7th, 2006, 9:23 PM
Replies: 13
Views: 401
Posted By Twilight
To fix your >> operator, try something like the...

To fix your >> operator, try something like the following:


istream& operator>>(istream& in)
{
for(char ch = in.get(); ch != /* whatever you use for a delimiter */ && !in.fail(); ch = in.get()
...
Forum: C++ May 4th, 2006, 4:53 PM
Replies: 32
Views: 733
Posted By Twilight
Yeah, just give addresses for the program to...

Yeah, just give addresses for the program to assign to, and it'll work fine.
Forum: C++ May 2nd, 2006, 7:37 PM
Replies: 9
Views: 320
Posted By Twilight
But wouldn't palindrome return the return value...

But wouldn't palindrome return the return value of his comparison?
Forum: C++ Apr 30th, 2006, 9:34 PM
Replies: 20
Views: 611
Posted By Twilight
Yeah, I had a feeling I was gonna get called on...

Yeah, I had a feeling I was gonna get called on the array thing, since it doesn't end up as a pointer when you convert it to assembly. But it's almost a pointer :p

However, I had no idea you could...
Forum: C++ Apr 30th, 2006, 1:54 AM
Replies: 18
Views: 573
Posted By Twilight
The VS Express Editions also autocomplete like...

The VS Express Editions also autocomplete like crazy. You type one letter, and it guesses (fairly well actually) at what word you were going to type, assuming you had defined it earlier. It also...
Forum: C++ Apr 30th, 2006, 1:52 AM
Replies: 20
Views: 611
Posted By Twilight
Odds are you've been using pointers all along and...

Odds are you've been using pointers all along and didn't even realize it. Like arrays for instance. All those really are is pointers.

And if you ever want to work with advanced data structures, or...
Forum: C++ Apr 28th, 2006, 7:34 PM
Replies: 18
Views: 573
Posted By Twilight
Well, as far as I'm aware, all VC++ offers is an...

Well, as far as I'm aware, all VC++ offers is an easier ability to create windows forms, with buttons and text boxes and such. However, C# was built specifically to do that kind of stuff, and is...
Showing results 1 to 40 of 67

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC