Forum: C++ 2 Days Ago |
| Replies: 2 Views: 112 Wow, deja vu, but better problem description.
The last word won't be followed by a space...
add another if (counter > longest_word) outside the for loop to handle the last word.
or... |
Forum: C++ 2 Days Ago |
| Replies: 2 Views: 125 as far as I can tell, you're only "drawing" the sides of the square, you didn't do the top or bottom yet...
In the sides code, the internal loop (for the spaces) is destructively decrementing your... |
Forum: C++ 2 Days Ago |
| Replies: 1 Views: 109 I'm presuming that x is the number of array entries you filled. A more descriptive name would be more appropriate.
line 15 in your code would be executed for every pass of the loop.
If the... |
Forum: C# 3 Days Ago |
| Replies: 3 Views: 130 Either the record doesn't exist (the dfSicilNo.Text does not exist) or if the record does exist, the field is null.
You should be able to ask the query how many rows (records) it returned (if it... |
Forum: C++ 4 Days Ago |
| Replies: 4 Views: 160 Well, ignoring that your input doesn't do much to protect the user from themselves (for example, enter "fred" when it asks for the account number and see what happens)...
Do you know in advance... |
Forum: C++ 4 Days Ago |
| Replies: 4 Views: 151 The previous posters point was that you have an IF statement on line 17...
an if is either true or false...
The 'true' clause has a return on line 19 and the 'false' clause has a return on line... |
Forum: Python 4 Days Ago |
| Replies: 9 Views: 211 The error you were reporting was based in your original code:
if letters[x] == ' ':
y = 0
message_number.append(y)
x = x+1
if letters[x] == 'A' or 'a':
... |
Forum: C++ Sep 30th, 2009 |
| Replies: 4 Views: 416 I'm not sure what your problem is, when I compile and run it:
start
Caught One! Ex. #: 1
Caught One! Ex. #: 2
Caught a string: Value is zero
Caught One! Ex. #: 3
end |
Forum: C++ Jul 29th, 2009 |
| Replies: 2 Views: 162 It looks like it compiled, so the symbol was defined enough for the compiler to recognize them.
The link process is where the actual executable is built. The linker needs to match up the symbol... |
Forum: C Apr 21st, 2009 |
| Replies: 6 Views: 715 Not surprisingly, but your program is doing what you told it to:
// Wait here for the user to enter a message
gets (msg);
while (msg != "q")
{
/* Write out message. */
... |
Forum: C# Apr 9th, 2009 |
| Replies: 5 Views: 410 So what you really want is a verification that a specific record (license) exists and you would never want anyone to be able to list or add records.
I'm not sure what resources you have available,... |
Forum: C# Apr 9th, 2009 |
| Replies: 5 Views: 410 Will the users of your application be connecting to your SQL server or is the intent for them to connect to their own server?
The following presumes they will be connecting to your server:
Hard... |
Forum: Python Mar 31st, 2009 |
| Replies: 12 Views: 759 Maybe you should look at the python bit-wise operators in the Python Docs (http://docs.python.org/reference/expressions.html#binary-bitwise-operations) |
Forum: C++ Mar 6th, 2009 |
| Replies: 4 Views: 1,154 const is a 'promise' not to change.
If you have member-functions that do not change your class (and never should) you can declare them const.
const member-functions are declared like this:
... |
Forum: C++ Mar 6th, 2009 |
| Replies: 10 Views: 600 @VernonDozier
You're right (again), I missed the fact that they would all be 3's to start.
Not that it is an excuse, but my convention for TTT win checks is to check for matches against the last... |
Forum: C++ Mar 6th, 2009 |
| Replies: 10 Views: 600 It would appear that inside move, placement is actually getting set to true when the game is 'won' but nothing is looking at placement to stop the game. The only stop case is when the board is full. |
Forum: C++ Mar 6th, 2009 |
| Replies: 10 Views: 600 Oh, and please:
When posting c++ code, please use c++ code tags
// Your code here |
Forum: C++ Mar 6th, 2009 |
| Replies: 10 Views: 600 Actually, it should never get to that print line...it returns from inside all over the function. (Though I'm not sure that the returns in all of the test are required.)
Is the board required to be... |
Forum: PHP Mar 3rd, 2009 |
| Replies: 14 Views: 688 I think nav33n (who re-posted your code) was trying to encourage you to use code tags.
Please use code tags when posting code. For more information, click here... |
Forum: C Mar 2nd, 2009 |
| Replies: 6 Views: 446 No the problem is with python...you can't run python code without having python installed (or using the large python dll that has all of the python stuff in it.) The python code expects that all to... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 2 Views: 248 Where is the declaration of com_num in relation to the order function? com_num needs to be visible to any compile target that can see order.
What specifically is the compiler error?
Which is... |
Forum: PHP Mar 2nd, 2009 |
| Replies: 14 Views: 688 I think the problem with the 'both' option is that when you select 'both' on the form, gender is set to '' and not to 'both'. |
Forum: C++ Feb 21st, 2009 |
| Replies: 14 Views: 859 Please when posting to these forums, wrap your code in code tags (like daviddoria did above).
Use either:
...
or
...
The second form provides for syntax highlighting and line numbers. |
Forum: C++ Feb 21st, 2009 |
| Replies: 6 Views: 811 If you don't intend to use any of the predefined C++ data types in your implementation, what do you propose to use?
A 6000 byte long number could be implemented, I would probably use an array with... |
Forum: Python Feb 8th, 2009 |
| Replies: 14 Views: 809 My prototype (really simple -- uses 3 copies of the sample data you posted) seems to work ok. I do parse the first input file 4 times (once for each of the fields I want). Then for each remaining... |
Forum: Python Feb 8th, 2009 |
| Replies: 14 Views: 809 So there will be 9126 columns of output (one extra for the headings)
and all of the values from one input file will be on one line in the output file?
Is the output file intended to be human... |
Forum: Python Feb 8th, 2009 |
| Replies: 14 Views: 809 It might help if you could write (in your own words) what it is that you think you need the program to do.
The first example looks something like:
There are 10 (or N?) input files with... |
Forum: C++ Jan 31st, 2009 |
| Replies: 16 Views: 1,277 Thanks for using tags, but your formatting could still use some work :)
If you use tags, the code will have line numbers and syntax highlighting.
The first section trying to validate input:
... |
Forum: C Jan 28th, 2009 |
| Replies: 5 Views: 543 I'm sorry, did you bother to read my post at all?
/* TAking input from user and storing it in ArrTemp array */
fgets(ArrTemp, ARR_TEMP_SIZE, stdin);
for(iLength=0; iLength<ARR_TEMP_SIZE;... |
Forum: C Jan 28th, 2009 |
| Replies: 5 Views: 543 problems in fnAddDepartment():
fgets(ArrTemp, ARR_TEMP_SIZE, stdin);
for(iLength=0; iLength<ARR_TEMP_SIZE; iLength++)
{
ArrTemp[iLength]=Dept_Name[iLength];
}
The... |
Forum: C++ Jan 26th, 2009 |
| Replies: 16 Views: 1,079 That's still pretty painful to look at, maybe if your code tag worked (use [code=c++] to start it (no spaces in the tag).
You have a for loop that i think was supposed to be closed, but was not:
... |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 695 I thought of a way to write your program without using the '||' operator would be to double the ifs and have 2 sections for each.
if (m == 3 && d >= 21)
printf("\nYour star is ARIES");
if... |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 695 Actually, that code tag message was intended as a reply for yabuki
But if you're not posting your code with code tags, feel free to use them :) |
Forum: C++ Jan 25th, 2009 |
| Replies: 12 Views: 636 You already have a 'global' (ok so it is local to the class, but all of the class methods can see it) data area defined. See this section under private in your class:
private:
double average;... |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 695 I don't think I can be much more blatant.
When you type:
int main() {
printf("Hello, World\n");
return 0;
} |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 695 That's very pretty code, but it should have been posted using code tags.
When posting c code, please use c code tags
/* Your code here */
And logically, the if statements you have don't... |
Forum: C++ Jan 25th, 2009 |
| Replies: 12 Views: 636 When you run the code, are you still having to put the grades in 4 times or did you fix that?
Could you post your new code? |
Forum: C++ Jan 25th, 2009 |
| Replies: 20 Views: 918 Quoting ... again:
You appear to have the same code in elapsed. You initialize duration to zero, compare it to t1 and t2 without doing anything with either value and return.
Perform the... |
Forum: C++ Jan 24th, 2009 |
| Replies: 20 Views: 918 Why are you trying to re-declare h inside the if statement?
if ( int h > 10)
should be:
if (h > 10) |
Forum: C Jan 24th, 2009 |
| Replies: 16 Views: 695 AND and OR are 2 similar but different constructs.
month = 3 && month == 4
Is an impossibility, it will NEVER happen
month == 3 || month == 4
happens for months 3 and 4 |