Search Results

Showing results 1 to 40 of 476
Search took 0.03 seconds.
Search: Posts Made By: nucleon
Forum: C++ Apr 27th, 2009
Replies: 46
Views: 2,287
Posted By nucleon
sid> But what annoyed me really was the reply of Nucleon.

Sorry if I made you cry, sid, but if my post imitating your style annoyed you, imagine how your original post felt to the OP. Are you...
Forum: C++ Apr 27th, 2009
Replies: 46
Views: 2,287
Posted By nucleon
sidiot> You won't see 'this' me in [other] posts
sidiot> If I was rude in this thread, it was for a reason.

This is simply a lie. There was absolutely no "reason" to be rude. Not only was the...
Forum: C Apr 27th, 2009
Replies: 7
Views: 721
Posted By nucleon
> I used that before, but ran into many problems.

It's still the way to go. Try out this program:

#include <stdio.h>

#define SIZE 100

int main()
{
Forum: C++ Apr 26th, 2009
Replies: 2
Views: 397
Posted By nucleon
This:
void FindcarVin(int , string , string, int , int );

is not the same as this:
void FindcarVin ( int vinnums[], string brandnames[], string modelnames[], int yearnums[], int specnum )

See...
Forum: C++ Apr 26th, 2009
Replies: 5
Views: 297
Posted By nucleon
I forgot that you will need to pass in the size of the array as well (unless you can change it to a vector). Here's the idea:

#include <iostream>
#include <fstream>
#include <string>
using...
Forum: C Apr 26th, 2009
Replies: 5
Views: 398
Posted By nucleon
The only line that looks like it might set up the error (through undefined behavior) is this: unidata.maxval=getMaxval(argv[1]);.

Presumably this function is in iplib2New.c. BTW, you're including...
Forum: C Apr 26th, 2009
Replies: 7
Views: 721
Posted By nucleon
I don't understand the question. Perhaps if you describe what you are trying to do. In general, people seem to be overusing strtok. Often it's not the way to go. Your's looks like a job for sscanf or...
Forum: C++ Apr 26th, 2009
Replies: 5
Views: 297
Posted By nucleon
Oops. Looks like I gave you the wrong prototype. Try:
void findvin( const Car* car );


Also, remember to use SIZE and not the number 30 in you code (since that's what SIZE is for).
Forum: C++ Apr 26th, 2009
Replies: 5
Views: 297
Posted By nucleon
Instead of a bunch of parallel arrays like this:

int vin[SIZE];
string brand[SIZE];
string model[SIZE];
int year[SIZE];
int mileage[SIZE];
double mpg[SIZE];

try a single array of structs...
Forum: C++ Apr 26th, 2009
Replies: 3
Views: 236
Posted By nucleon
Minimally you must handle single quotes, double quotes, single-line comments, and multi-line comments, since, as ArkM has pointed out, these constructs may contain parens (etc.) which you will want...
Forum: C Apr 26th, 2009
Replies: 5
Views: 398
Posted By nucleon
> the lack of any apparent connection makes me think i'm initiating
> something else (one of the libraries or something from the OS)
> that has a run-time error

Although possible, you should...
Forum: C++ Apr 26th, 2009
Replies: 8
Views: 451
Posted By nucleon
The best solution is always the simplest one that does the trick. So, since you're only instantiating it with one type (i.e., a Comparable and it's derivatives), you don't need a template. That's...
Forum: C++ Apr 26th, 2009
Replies: 9
Views: 1,086
Posted By nucleon
The whole point of prefix notation is to represent the formula in such a way as to eliminate the complications of precedence and association. To reinstate these complications is sidiotic.

I feel...
Forum: C++ Apr 26th, 2009
Replies: 3
Views: 1,016
Posted By nucleon
main must return int (not void).
You are missing a closing brace.
"five" is a strange name.
datum is spelled with a u.
See comments in program.

#include <iostream>
#include <fstream>...
Forum: C++ Apr 26th, 2009
Replies: 35
Views: 1,961
Posted By nucleon
When Knuth talks about random numbers he mentions a CD of random numbers called "Black and White Noise" which is a mixture of deterministically sampled rap music combined with white noise.
Forum: C++ Apr 26th, 2009
Replies: 10
Views: 406
Posted By nucleon
So you're saying that if you take the exact same exe and config file that works on your machine and transfer it to your friend's machine, it doesn't work?

Does he have the exact same OS as you?...
Forum: C Apr 26th, 2009
Replies: 5
Views: 709
Posted By nucleon
> How would I set it as a Global variable

This question suggests that you may not be ready for WinAPI programming. You should master the programming language with console programs.

To make it...
Forum: C Apr 25th, 2009
Replies: 5
Views: 709
Posted By nucleon
ThreadTime does not have access to hWndDlg. You need to either make it global (DlgProc would set the global var in WM_INITDIALOG)or pass it as a parameter to ThreadTime.
Forum: C++ Apr 25th, 2009
Replies: 46
Views: 2,287
Posted By nucleon
sid> Just check what would happened if delete would reset the pointer to zero:

Nothing would happen! Are you a mindless idiot? Did your brain fall out? Did you replace it with a turd you found on...
Forum: C++ Apr 24th, 2009
Replies: 4
Views: 412
Posted By nucleon
We need code tags (http://www.daniweb.com/forums/misc-explaincode.html) and more explanation.
Forum: C Apr 24th, 2009
Replies: 5
Views: 742
Posted By nucleon
Sounds good. :)

I forgot to mention above that if you do remove <afxres.h> (and use -1 instead of IDC_STATIC) you probably have to replace it with <windows.h>.
Forum: C Apr 24th, 2009
Replies: 5
Views: 742
Posted By nucleon
The FONT line is about the 7th line in gui.rc. Put the MENU line after that.

In that same file you can get rid of <afxres.h> if you replace IDC_STATIC with its value, -1. I believe most people do...
Forum: C++ Apr 24th, 2009
Replies: 2
Views: 535
Posted By nucleon
Write it to a string with sprintf (or wsprintf):

sprintf( buf, "Random Number: %d", random_integer );
MessageBox( 0, buf, ... )
Forum: C Apr 24th, 2009
Replies: 5
Views: 742
Posted By nucleon
You haven't associated the menu with the dialog. Add this line after the FONT line in the dialog definition:
MENU IDR_MAIN_MENU
Forum: C Apr 24th, 2009
Replies: 4
Views: 551
Posted By nucleon
So you're saying that this piece of code will send a jpg file the first time it executes but not the second time or after that? What's the value of bytes_sent when the error occurs? If it is -1, what...
Forum: C Apr 24th, 2009
Replies: 8
Views: 1,200
Posted By nucleon
You may be able to figure it out with some detective work. Try running the old program and the new program in such a way that they should produce the same data. Then compare the files (viewing the...
Forum: C Apr 24th, 2009
Replies: 8
Views: 1,200
Posted By nucleon
So you basically want to write a program that will translate the new format binary file into the old format text file?
If it's a free program, can you get the source?
Or can you find a description...
Forum: C Apr 24th, 2009
Replies: 8
Views: 1,200
Posted By nucleon
It's quite a challenge decoding a binary file with an unkown format! In general, it's not possible. How do you know if the first two bytes are the characters AB or the 16-bit integer with decimal...
Forum: C++ Apr 24th, 2009
Replies: 2
Views: 446
Posted By nucleon
You could try a different IDE/compiler.
MSVC++ defaults to unicode.
Forum: C++ Apr 24th, 2009
Replies: 10
Views: 495
Posted By nucleon
No problem. :)

While I remember, you should change the test: b<MAX_KEYNAME_CHARLENGTH to b<MAX_KEYNAME_CHARLENGTH - 1, otherwise you might overrun found_key.

And remember to test the return...
Forum: C Apr 24th, 2009
Replies: 57
Views: 2,397
Posted By nucleon
There WAS a problem in reading in the data. I don't know if I did it or you, but the extra strtok (to get rid of the letters A, B, C in the data) needs to be inside the loop. So change the code as...
Forum: C Apr 24th, 2009
Replies: 57
Views: 2,397
Posted By nucleon
That's how it looks to me too. If you rotate the pyramid it will actually disappear at one point. I don't know if that's a related problem or if that's how it always worked. Test out rotating the...
Forum: C Apr 24th, 2009
Replies: 57
Views: 2,397
Posted By nucleon
Turns out the data structure was okay after all (it only crashed because I had forgotten to allocate space for the scene in my test program).

But I found the problem. It had to do with passing...
Forum: C Apr 24th, 2009
Replies: 57
Views: 2,397
Posted By nucleon
MF: We've got bigger fish to fry! But that's definitely a good idea.

caged_fire: I've created a opengl-free version to just read and print the data structure and I'm getting errors with it! I...
Forum: C Apr 24th, 2009
Replies: 57
Views: 2,397
Posted By nucleon
That is strange. I finally got it to run just now. There's a black-and-white checkerboard "floor", a blue "sky", and a box and a pyramid floating in the sky.
Forum: C Apr 23rd, 2009
Replies: 57
Views: 2,397
Posted By nucleon
Oops! Remove the ampersand from that one. So it should be:
glVertex3fv(object->vertices[facet[i]]);


Also, you might want to use atoi instead of atof in the line given below since you're reading...
Forum: C Apr 23rd, 2009
Replies: 57
Views: 2,397
Posted By nucleon
Try this. ;) But it's the essentially the same. Attach your project.c file if it's still not working.

void drawPolygon( Object *object, int iFacet )
{
int i;
int *facet =...
Forum: C++ Apr 23rd, 2009
Replies: 10
Views: 495
Posted By nucleon
You define a buffer called found_key to hold each key as it is read. It has a length of MAX_KEYNAME_CHARLENGTH (defined, suspiciously, as 20).

If you are sure your keys will never be more than 19...
Forum: C Apr 23rd, 2009
Replies: 4
Views: 476
Posted By nucleon
Instead of setting pid and ppid, don't you just want to print them? You cannot return them to the parent (well, you can, but it does not seem to be necessary in this assignment).

And your code is...
Forum: C Apr 23rd, 2009
Replies: 57
Views: 2,397
Posted By nucleon
I believe this works.

void drawPolygon( Object *object, int iFacet )
{
int i;
int *facet = &object->facets[iFacet][0];

glBegin( GL_POLYGON );
glColor3ub( 128, 64, 0 );
Showing results 1 to 40 of 476

 


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

©2003 - 2009 DaniWeb® LLC