Programming Forums
User Name Password Register
 

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

Showing results 1 to 40 of 500
Search took 0.10 seconds.
Search: Posts Made By: grumpy
Forum: C++ Jul 17th, 2008, 3:25 AM
Replies: 7
Views: 118
Posted By grumpy
Re: Wrong output with while loop.

The simpler fix would be to terminate the loop if any of the operations (cin.get() or cin << gradeavg) encounter an error.
Forum: Python Jul 13th, 2008, 11:47 PM
Replies: 5
Views: 154
Posted By grumpy
Re: A numerical problem - I need an algorithm to solve it

Mathematically, very integer has a factor less or equal to the square root and it is paired with another factor greater than or equal to the square root. From this, you can work out the maximum...
Forum: Java Jul 13th, 2008, 6:01 AM
Replies: 4
Views: 105
Posted By grumpy
Re: Bug Writing Program

The core concept I suggest you pursue, tohndef, is the writing of a business case. In it, identify the weaknesses of packages you're using, the impact of those weaknesses, your strategy for...
Forum: Java Jul 13th, 2008, 1:48 AM
Replies: 4
Views: 105
Posted By grumpy
Re: Bug Writing Program

General comment: you're putting the cart before the horse. Those who follow such a horse only see a horses behind that is going nowhere.

Bug tracking software like Bugzilla is a tool used to...
Forum: Java Jul 11th, 2008, 5:54 PM
Replies: 2
Views: 71
Posted By grumpy
Re: Error in Inner Class

You've made a typo. The name "actionPerformed" needs two r's not one.
Forum: C++ Jul 11th, 2008, 5:06 AM
Replies: 2
Views: 87
Posted By grumpy
Re: How to change the color of my text

You need to read the sticky post in the C++ forum entitled "How to ask a question".

However, to answer your question: you can't, at least not in standard C++.

Text colour is manipulated in manners...
Forum: Coder's Corner Lounge Jul 4th, 2008, 4:47 PM
Replies: 3
Views: 156
Posted By grumpy
Re: How is it faster

It's not a speed of language issue as such. It's speed of execution of the programs after they are translated into a form they can be run. C++ allows the programmer to do things in which the...
Forum: C++ Jul 4th, 2008, 4:05 AM
Replies: 4
Views: 156
Posted By grumpy
Re: Library function implementation

Declare/define your function myfunc() with arguments of type std::container<TYPE>::forward_iterator, and do not overload it for other types. If you attempt to call it with arguments of types other...
Forum: C++ Jul 3rd, 2008, 5:21 AM
Replies: 4
Views: 156
Posted By grumpy
Re: Library function implementation

Assuming you have a standard container, the type of its iterators are of the form std::container<TYPE>::iterator_type (where container = vector, list, etc, TYPE is the type of element, and...
Forum: C Jul 3rd, 2008, 5:06 AM
Replies: 1
Views: 148
Posted By grumpy
Re: I need help!!!

Following this link: httt://googleityoumoron.com (http://www.google.com) and typing in "pwm signal powerpc mpc555" will get you started.
Forum: C++ Jul 3rd, 2008, 5:01 AM
Replies: 7
Views: 202
Posted By grumpy
Re: error: passing as 'this' discards qualifiers

By this, I assume you mean that pieces is not an array of PieceDict (i.e. piece[x] is not a PieceDict so one needs to be constructed from piece[x]).

This means PieceDict needs a constructor of the...
Forum: C++ Jul 2nd, 2008, 3:54 AM
Replies: 7
Views: 202
Posted By grumpy
Re: error: passing as 'this' discards qualifiers

Why do you have operator[], which returns a const reference, creating a new object? You could also simply do this;

const Board::PieceDict& Board::operator[] (unsigned int x) const
{
return...
Forum: C++ Jun 28th, 2008, 10:12 PM
Replies: 4
Views: 187
Posted By grumpy
Re: Virtual global functions

You're mixing up the concepts (or your book is), and imposing rules (or expectations) unnecessarily.

Firstly, there is nothing sacrosanct about "OOP" that requires everything to be an object, or...
Forum: C++ Jun 28th, 2008, 2:27 AM
Replies: 4
Views: 187
Posted By grumpy
Re: Virtual global functions

operator<<() function like the above are never part of a class definition anyway.

It is possible to declare and define a std::ostream& operator << (std::ostream& os, const DerivedClass& dc);. The...
Forum: C Jun 27th, 2008, 3:15 PM
Replies: 10
Views: 347
Posted By grumpy
Re: Errors with realloc() w.r.t. writing managing shared memory

Dark is right. If the second usage of ALLOC() reallocates a->mem, then x becomes a dangling pointer to a memory location into the old a->mem (old = corresponding to the value of a->mem held before...
Forum: C++ Jun 23rd, 2008, 1:47 PM
Replies: 10
Views: 326
Posted By grumpy
Re: c++ header standards

Correct, Narue. I evidently had a brain fart.
Forum: C++ Jun 23rd, 2008, 4:28 AM
Replies: 10
Views: 326
Posted By grumpy
Re: c++ header standards

Allocating raw memory (which is all malloc() does) is one of the steps in dynamically creating an object (or multiple objects) with operator new. That step occurs before constructor(s) are invoked...
Forum: C++ Jun 22nd, 2008, 12:22 AM
Replies: 10
Views: 326
Posted By grumpy
Re: c++ header standards

malloc(), calloc(), realloc(), and free() are declared within <stdlib.h> (C, deprecated in C++) and <cstdlib> (C++, also in namespace std).

Surely, your compiler documentation would have had some...
Forum: C++ Jun 21st, 2008, 6:54 AM
Replies: 10
Views: 326
Posted By grumpy
Re: c++ header standards

Neither. There is no standard header named <memory.h> specified in either the C or C++ standards. The C++ standard also specifies no standard header named <memory> or <cmemory>.

If you are...
Forum: C++ Jun 21st, 2008, 1:23 AM
Replies: 4
Views: 171
Posted By grumpy
Re: timed functions

clock() also returns approximate values of processor time, in an implementation defined manner, not elapsed time. The relationship between processor time and elapsed time depends on things like...
Forum: C++ Jun 20th, 2008, 4:21 PM
Replies: 4
Views: 171
Posted By grumpy
Re: timed functions

Not in standard C/C++.

Most modern systems, however, have some form of timer mechanism that allows a message/signal to be sent to your program at some defined interval, and your program can respond...
Forum: Other Programming Languages Jun 19th, 2008, 6:32 AM
Replies: 18
Views: 649
Posted By grumpy
Re: D Programing Language-To replace C/C++?

A friend of mine wrote a game of hangman in Cobol .... as a learning exercise.
Forum: C Jun 17th, 2008, 7:01 AM
Replies: 6
Views: 223
Posted By grumpy
Re: Converting Temperatures

A conversion/cast is not required. Simply use 9.0f/5.0f (or 1.80f) to have literals that are of type float.
Forum: Other Programming Languages Jun 16th, 2008, 4:41 AM
Replies: 18
Views: 649
Posted By grumpy
Re: D Programing Language-To replace C/C++?

One of the topics of discussion by the C++ standard committee is options for multithreading. It is actually a fairly challenging problem, given the need to be able to do it portably and still work...
Forum: Other Programming Languages Jun 15th, 2008, 6:51 AM
Replies: 18
Views: 649
Posted By grumpy
Re: D Programing Language-To replace C/C++?

Depending on why you are learning.

As a language for beginners (who need to pick up some understanding of how computers work, and how to do things systematically) Java is not a language I would...
Forum: Other Programming Languages Jun 15th, 2008, 5:27 AM
Replies: 18
Views: 649
Posted By grumpy
Re: D Programing Language-To replace C/C++?

There will always be new programming languages and claims those new languages will replace older languages because they are more powerful, easier to use, less error prone, more portable, faster,...
Forum: C++ Jun 13th, 2008, 5:37 PM
Replies: 11
Views: 430
Posted By grumpy
Re: Memory Leaks

I tend to agree with soulstorm on garbage collection. Garbage collectors are useful, if they are used in a disciplined manner, but it takes a lot of effort to use them properly. In practice, it is...
Forum: C++ Jun 9th, 2008, 4:30 PM
Replies: 12
Views: 318
Posted By grumpy
Re: Cross-platform exec()

Given that command shells (the things executed by system() on unix variants, as an intermediary to executing your string) vary between flavours of unix, and also with whims of system administrators...
Forum: C++ Jun 9th, 2008, 3:39 PM
Replies: 12
Views: 318
Posted By grumpy
Re: Cross-platform exec()

That is only true on some target platforms, and with some libraries. It is not a predictable result.

The C standard has this to say on system(), and is all that can relied upon in cross-platform...
Forum: C++ Jun 8th, 2008, 10:16 PM
Replies: 12
Views: 318
Posted By grumpy
Re: Cross-platform exec()

There is no direct fork() equivalent under windows [creating a duplicate of the current process with the same state, except being able to detect it is forked] but it is possible to create a new...
Forum: Coder's Corner Lounge Jun 5th, 2008, 3:41 AM
Replies: 18
Views: 486
Posted By grumpy
Re: Best programming language

Not really. Assembler and/or machine opcodes are the real building blocks ... they were used to build the first compilers before C was even thought of.
Forum: C++ Jun 2nd, 2008, 4:37 PM
Replies: 6
Views: 283
Posted By grumpy
Re: When will i ever use pointers?

I don't really agree with this.

My first programming language was Fortran 77, and some of the most significant applications I ever wrote were in that language. Fortran 77 does not support any...
Forum: C Jun 2nd, 2008, 3:57 AM
Replies: 4
Views: 177
Posted By grumpy
Re: So far my program is running fine but im getting a warning on Dev Cpp

Also, since receipt contains the address of an int, remove the ampersand from this line....

scanf ("%d", &receipt);
Forum: C++ May 28th, 2008, 3:36 AM
Replies: 19
Views: 712
Posted By grumpy
Re: C++ compilers?

My guess is that you've paraphrased your code, and not posted the actual code you fed to your compiler. Based on that guess, you probably left out a character somewhere and/or commented out...
Forum: C++ May 26th, 2008, 6:48 AM
Replies: 8
Views: 335
Posted By grumpy
Re: Reading text from a file.

Most obvious thing to check: does the file exist?

A common occurrence is for the current working directory differs from the directory that the file ("test.txt") is in - i.e. the file is not in the...
Forum: Java May 20th, 2008, 7:51 AM
Replies: 1
Views: 107
Posted By grumpy
Re: Monitoring email traffic

Most email clients have an ability to automatically save the addresses email is sent to. Have a look through your configuration settings.
Forum: C++ May 16th, 2008, 2:13 PM
Replies: 9
Views: 420
Posted By grumpy
Re: File comparison program

Firstly, you need to be aware that your program cannot be written in standard C++: the means getting names of files, their size, and attributes (system or hidden) are not part of C++. They are...
Forum: Coder's Corner Lounge May 15th, 2008, 4:47 AM
Replies: 9
Views: 396
Posted By grumpy
Re: Anyone a genius?

Not quite so, Fallback Son. Tail recursion simply means that the last operation in a function is a call to itself. So;

int CallMySelfAgain(int i)
{
if (SomeResult(i))
return...
Forum: C++ May 13th, 2008, 5:01 AM
Replies: 12
Views: 502
Posted By grumpy
Re: What is the best language to start with?

Personally, the first programming language I learned was Fortran 77. :twisted:

Seriously, the choice of first programming language is not all that significant. The important thing is...
Forum: Community Announcements and Feedback May 13th, 2008, 4:27 AM
Replies: 22
Views: 932
Posted By grumpy
Re: Forum System Upgrade

Don't worry about it, it's not a problem. I ran into the problem only because I prefer to tie things down, and check things before easing settings. Now that I know, I'm happy.
Showing results 1 to 40 of 500

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:51 PM.

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