User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 374,512 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,857 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Showing results 1 to 40 of 500
Search took 0.07 seconds.
Posts Made By: VernonDozier
Forum: C++ 49 Minutes Ago
Replies: 7
Views: 63
Posted By VernonDozier
Re: need help with this.

I assume you mean "right"? Please don't use text-speak. Yes, arrays in C++ start at 0 so if you have an array int month[12] , you want to use array indexes 0 through 11, not 1 through 12, Also,...
Forum: Java 1 Hour Ago
Replies: 4
Views: 68
Posted By VernonDozier
Re: How do you save a JPanel as a GIF file?

Awesome. Ezzaral, it worked on the first try! Thank you. I'm still going over the code line by line to try to get my hands around it, but like I said, it worked. Alex, thank you for the links. ...
Forum: C++ 2 Hours Ago
Replies: 7
Views: 63
Posted By VernonDozier
Re: need help with this.

Well, you can "write your own", use code that's already written, or do a combination. A lot has been written. One potential drawback of some of it is that it only works with dates after 1900 or...
Forum: C++ 3 Hours Ago
Replies: 4
Views: 68
Posted By VernonDozier
Re: popen

I don't think you're supposed to get "C:\documents and settings\...." when you run this. That's the command line prompt, not part of the program. The output I got from the program was the same as...
Forum: C 4 Hours Ago
Replies: 9
Views: 104
Posted By VernonDozier
Re: Quadratic Formula

Ah, OK, you are referring to these lines, perhaps?


x = ((-b - d)/(2.0*a));
y = ((-b + d)/(2.0*a));


I get a warning in C++ (not an error) which says "Warning: Converting from 'int' to 'double'". ...
Forum: C 4 Hours Ago
Replies: 9
Views: 104
Posted By VernonDozier
Re: Quadratic Formula

You have that backwards. These lines:


#include <iostream>
using namespace std;


are fine with a C++ compiler, but cannot be used with a C compiler.
Forum: Java 13 Hours Ago
Replies: 4
Views: 68
Posted By VernonDozier
How do you save a JPanel as a GIF file?

I've made a small program that draws black rectangles on a JPanel at random places. I would like to give the user the option to save this JPanel as a .gif file, but I'm not sure where to start. The...
Forum: C 14 Hours Ago
Replies: 9
Views: 104
Posted By VernonDozier
Re: Quadratic Formula

iostream isn't in C. I think you have quotes where you want <> in your #include for math.h, and you can't use "using namespace std" in C. Maybe you're not using a C compiler.

The problem with the...
Forum: C++ 15 Hours Ago
Replies: 3
Views: 68
Posted By VernonDozier
Re: random number guess

I'll start you off with the first function, PrintHeading(int). This is simply taking lines 44 through 52 above, taking them out of main, and putting them into PrintHeading(int). In addition, the...
Forum: C 18 Hours Ago
Replies: 4
Views: 83
Posted By VernonDozier
Re: shortcut to a large number of nested if-else statements

Definitely don't write 100 if statements. If you have a 2-D array of doubles, like, say:


double groups[100][MAX_NUM_ELEMENTS_IN_GROUP];


where 100 is the number of groups, as in your case, and...
Forum: C++ 21 Hours Ago
Replies: 6
Views: 95
Posted By VernonDozier
Re: New to C++ and programming: PLEASE HELP!!!!! with "Switch"

case 2:
cout << "Please enter the year.\n";
cin >> Year;
break; // delete this line

if (Year % 4 == 0)
cout << "February has 29 days. This is a Leap Year\n";
else
cout << "February...
Forum: C++ 21 Hours Ago
Replies: 3
Views: 47
Posted By VernonDozier
Re: error C2296

FYI, the bold tags don't work with C++ style code tags. They DO work with non-specific code tags:



// paste code here. Can put bold highlighting.



The C++ highlighting seems to override the...
Forum: C++ 23 Hours Ago
Replies: 1
Views: 56
Posted By VernonDozier
Re: binay heap and binary search tree help

Google is your friend, as well as Daniweb's and a dozen other programming forums' search engines. These are very common problems and come up all the time, so odds are that if you enter "binary...
Forum: C++ 23 Hours Ago
Replies: 3
Views: 73
Posted By VernonDozier
Re: losing decimal precision in division

Use strtod from cstdlib. You'll need to convert the string to a c-string before applying strtod.


string stringNum = "67.34512";
double number = strtod(stringNum.c_str(),...
Forum: C++ 1 Day Ago
Replies: 3
Views: 73
Posted By VernonDozier
Re: losing decimal precision in division

vector is not getting chopped off in memory, just in the display. It is stored in memory correctly. What IS being chopped off is the DISPLAY to the screen of vector. cout has a default of 6...
Forum: Java 1 Day Ago
Replies: 17
Views: 326
Posted By VernonDozier
Re: Multi Thread Help

Let me actually clarify/correct my previous post, and reiterate that I'm somewhat out of my league on sockets. I've written a single-server, multi-client socket program successfully, but usually...
Forum: Java 1 Day Ago
Replies: 17
Views: 326
Posted By VernonDozier
Re: Multi Thread Help

It looks to me like the server only creates one socket and uses one port at a time. One guest program and one server program connect through that socket. I'm no expert on sockets and I could be...
Forum: C++ 1 Day Ago
Replies: 14
Views: 210
Posted By VernonDozier
Re: using an if inside a for loop

Use the noparse tag.





// pasted code here
Forum: Java 1 Day Ago
Replies: 15
Views: 149
Posted By VernonDozier
Re: Please Help Compiling Error

What's the question? It ran, but You haven't implemented the DecimalFormat that I linked. Here's a good example of it from Daniweb.

http://www.daniweb.com/forums/thread20141.html
Forum: Java 1 Day Ago
Replies: 15
Views: 149
Posted By VernonDozier
Re: Please Help Compiling Error

Close. You got the end tag wrong. It's



// paste code


not

[code=JAVA]
Forum: C++ 1 Day Ago
Replies: 14
Views: 210
Posted By VernonDozier
Re: using an if inside a for loop

My Spanish isn't what it used to be, so I'm not exactly sure what's going on, but I ran it and got the infinite loop and I think probably the culprit is that you are confusing the = operator and the...
Forum: C++ 1 Day Ago
Replies: 14
Views: 210
Posted By VernonDozier
Re: using an if inside a for loop

Code tags work like this. Don't use icode tags.



// paste code here


or
Forum: Java 1 Day Ago
Replies: 15
Views: 149
Posted By VernonDozier
Re: Please Help Compiling Error

Post your updated code with Java-style code tags, which will add line numbers, then refer to the specific line number you are referring to. I don't know what line you are speaking about and I don't...
Forum: Java 1 Day Ago
Replies: 15
Views: 149
Posted By VernonDozier
Re: Please Help Compiling Error

Well, try it and find out. Don't be afraid to experiment. You at least won't get THAT error anymore if you make them the same, but you may have other errors. It is something you need to fix if you...
Forum: C++ 1 Day Ago
Replies: 14
Views: 210
Posted By VernonDozier
Re: using an if inside a for loop

Please don't use leet-speak. He's asking whether the for-loop should always be executed, regardless of whether the if-condition is true. If it should always be executed, then don't put the for-loop...
Forum: Java 1 Day Ago
Replies: 15
Views: 149
Posted By VernonDozier
Re: Please Help Compiling Error

Alex did a good job of explaining it above. Product is the superclass. Movie is the subclass. Inside your Movie constructor, you have this line:


super( dvdTitle, dvdItemNumber, dvdStock,...
Forum: C++ 1 Day Ago
Replies: 10
Views: 160
Posted By VernonDozier
Re: Need help adding a search function.

Is this the code? Are you subtracting an iterator from a vector? I don't think ArkM intended you to literally use "vector - scan" in the code. I think that was just a hyphen in the sentence. You...
Forum: C++ 2 Days Ago
Replies: 6
Views: 103
Posted By VernonDozier
Re: errors in game code

bool play(int nrz,int nrholes,int plain[10][10])
{
bool dead,endgame;
endgame = false;
dead = false;
while (true)

{
endgame = movezombies(plain);
dead =...
Forum: Java 2 Days Ago
Replies: 30
Views: 484
Posted By VernonDozier
Re: help please

"u have to help him ..."

Wrong, pal. No one HAS to do anything. This is all strictly voluntary. No one gets paid here, so everyone picks and chooses who to help. A big part of that choice is...
Forum: C++ 2 Days Ago
Replies: 8
Views: 117
Posted By VernonDozier
Re: How to initialize a vector of pointers?

Yep. Here's an example.


#include <vector>
#include <iostream>
using namespace std;


void DisplayVector(vector <int*> myVector);
Forum: C++ 3 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

This doesn't have anything to do with the code. It looks like you created the wrong type of project. You can create a new project, click "Win32 Console Application" as the project type, then...
Forum: C++ 3 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

That error makes perfect sense because that's a real error. The first int main () shouldn't be there. What doesn't make sense to me are the two errors that you got when you deleted that first int...
Forum: C++ 3 Days Ago
Replies: 1
Views: 114
Posted By VernonDozier
Re: Chatting Application using C++ (or C#)

You are probably looking at some type of connection through sockets. If you are brand new at this, I suggest going through some socket tutorials/sample code till you get a handle on it. Some of...
Forum: C++ 3 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

There is no last error. Comment out or delete that first int main() line and the code you posted will compile and run without error. It won't run very well due to design flaws, but it will compile...
Forum: C++ 3 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

#include<iostream>
using namespace std;
int main() // delete this line

char board[3][3];
char letterNum;
void displayBoard();
void move();

// code
Forum: C++ 3 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

Reread Lerner's and invisal's and my posts. As Lerner and invisal mentioned, you don't want this code in your displayBoard function:


board[0][0] = '1';
board[0][1] = '2';
board[0][2] =...
Forum: Java 3 Days Ago
Replies: 19
Views: 377
Posted By VernonDozier
Re: Design issue - checkers game

Here is my approach, based on what i believe the reasonable assumptions should be. One, a good checkers game should be able to function in a variety of environments. Thus it should be written so...
Forum: C++ 4 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

It may not make a difference on the computer/operating system you are using, but it is not portable to all computers/operating systems so that is why there are many threads on Daniweb discouraging...
Forum: C++ 4 Days Ago
Replies: 40
Views: 473
Posted By VernonDozier
Re: Array help

As invisal mentioned, you need to tell us what the question/problem is. You should tell us what the goal of the program is, what its desired behavior is, what its actual behavior is, and where you...
Forum: C++ 4 Days Ago
Replies: 9
Views: 170
Posted By VernonDozier
Re: Cesar Cipher in c++

I would guess then that the problem is that the out array is not initialized correctly. I see nowhere where you strcpy the in array to the out array before going through the loop. If you initialize...
Showing results 1 to 40 of 500

 
All times are GMT -4. The time now is 2:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC