Forum: C Aug 25th, 2008 |
| Replies: 10 Views: 1,306 I doubt very much if he has a lot of choices right now (after the school year has started), in what compiler the class is using, or what college to attend based on the compiler being used.
Turbo C... |
Forum: C Aug 6th, 2008 |
| Replies: 24 Views: 2,008 I wouldn't know - it's in WindowsXP, and despite all the "hand-waving" of supremely relevant facts you've made, this is all transparent to the user. And much faster with the current hardware, so I... |
Forum: C Aug 6th, 2008 |
| Replies: 24 Views: 2,008 Of course you got an error, you didn't follow my posts information. :)
For Windows, you have to use Gotoxy(x,y), and include the right header file for it, of course. For conio.h, you have to use... |
Forum: C Aug 4th, 2008 |
| Replies: 24 Views: 2,008 I found your previous post passionless and somewhat ambiguous other than re-stating the obvious, regarding using conio.h and gotoxy()/Gotoxy(), which are not "undefined" with either the right OS... |
Forum: C Aug 4th, 2008 |
| Replies: 24 Views: 2,008 What unpredictability?
If you have a Windows OS, Gotoxy() always works. If you have the header file conio.h, gotoxy() always works.
I've used gotoxy() on everything from DOS 3.1 through... |
Forum: C Aug 4th, 2008 |
| Replies: 24 Views: 2,008 Then I would *hope* that we are better programmers, even if sometimes our manners are not quite up to an acceptable level of social etiquette.
C has an odd landscape. In a strong effort to be... |
Forum: C Aug 4th, 2008 |
| Replies: 7 Views: 1,224 OK, I see your listbox pic. Do you have any questions about my previous posts? |
Forum: C Aug 3rd, 2008 |
| Replies: 7 Views: 1,224 I forgot to mention the "auto complete" function.
To simplify matters, I would always have the first letter search, stop at the first alphabetical letter match, it finds, as mentioned in my post... |
Forum: C Aug 3rd, 2008 |
| Replies: 7 Views: 1,224 Your url takes us to Free Image Hosting, but not to your picture/image. :(
You have a large sorted list, and a binary search would be excellent. You'll need a few little tweaks to it:
1) If the... |
Forum: C Aug 1st, 2008 |
| Replies: 7 Views: 2,968 Of course, you don't need an array for min and max, if you just print the column's min and max, at the end of each column's check.
Simple. :) |
Forum: C Aug 1st, 2008 |
| Replies: 7 Views: 2,968 Is this what you're looking to do?
colMin = array[0][0];
colMax = array[0][0];
for (col = 0; col < MaxCol; col++) {
for(row = 0; row < MaxRow; row++) {
if(colMin) >... |
Forum: C Aug 1st, 2008 |
| Replies: 5 Views: 571 Let's look at #1, is the move legal:
Pretty straight forward logic. If the square is empty for the requested move, then the move is legal. Normally a function return value of 0 indicates a "good"... |
Forum: C Aug 1st, 2008 |
| Replies: 5 Views: 571 Bingo! :)
If the array index for the board is != EMPTY, then you can't move there. You can #define EMPTY to be any value you like, including just zero.
So:
1) test if the move that has... |
Forum: C Aug 1st, 2008 |
| Replies: 8 Views: 1,322 |
Forum: C Jul 31st, 2008 |
| Replies: 5 Views: 571 Basic error in your logic. You can't say for sure that the game is not over NOW, (after the opponent or yourself, has made a move), unless you check, first. I use a function named IsWin(), but the... |
Forum: C Jul 24th, 2008 |
| Replies: 8 Views: 1,322 OK, some basics:
1) whether you write out the values as binary or decimal, you'll be using ASCII if your OS uses ASCII (and yours almost certainly does). Binary files will be smaller than text... |
Forum: C Jul 24th, 2008 |
| Replies: 6 Views: 1,430 I want to heartily second Vernon's post - not only is it a great trick for your problem, but it can be used for many others, as well. It's usually called Distributed Counting or Bucketsort, but you... |
Forum: C Jul 24th, 2008 |
| Replies: 12 Views: 1,556 Yes, we can help, but I see no program to help.
We help - we do not *do* the homework for you. |
Forum: C Jul 24th, 2008 |
| Replies: 10 Views: 2,202 |
Forum: C Jul 23rd, 2008 |
| Replies: 12 Views: 10,088 You made me laugh with your post to convert decimal to hex, including "A,B...G"
*G* ?? :D
Anyway, your algorithm to change decimal to hexadecimal is wrong. Here's a modded version of your... |
Forum: C Jul 22nd, 2008 |
| Replies: 38 Views: 2,428 I believe this will work better. Note that you were writing out the variables in a slightly different order than you were fscanf'ing them back in, and the failing message shouldn't go into the data... |
Forum: C Jul 21st, 2008 |
| Replies: 8 Views: 640 In main() you call the menu() function. The menu() function has a very large do while loop in it that usually starts with ** Welcome to ...... **" kind of banner at the top.
Inside the menu(),... |
Forum: C Jul 21st, 2008 |
| Replies: 38 Views: 2,428 I don't want to modify your code. I want you to get smart enough to modify your own code.
If you can write out one record, you can write out a million records, but you can't write out records... |
Forum: C Jul 21st, 2008 |
| Replies: 11 Views: 1,314 What compiler are you using?
Does it have a "conio.h" file? Does it have a "window" or similar command to create a text mode window?
Because as I'm typing in your program's window, the letters... |
Forum: C Jul 21st, 2008 |
| Replies: 11 Views: 1,314 When you press enter on 4th row, the letters on the 4th row, should be moved up to the 3rd row. The cursor will still be on the 4th row (because that is your bottom row), and that 4th row will now be... |
Forum: C Jul 20th, 2008 |
| Replies: 11 Views: 1,314 Posting up my editor would do you no good. I was a student when I wrote it, and it's in another language.
You can reprint the array via code like this:
for(row = 1; row < 5; row++) {
... |
Forum: C Jul 20th, 2008 |
| Replies: 11 Views: 1,314 I don't see any differentiation between the cursor being on the last line, and the cursor being on some other line of the screen.
It is impossible for me to tell what's wrong without the full... |
Forum: C Jul 19th, 2008 |
| Replies: 12 Views: 3,287 He's hapless, or just acting helpless? His help file, his man file, his book, his notes, google, etc., have no info on continue, break, or return?
Hahahahaha! :D :D
Would you like to answer... |
Forum: C Jul 19th, 2008 |
| Replies: 11 Views: 1,314 Yes, the text on the screen will only scroll when you have the cursor on the bottom row of the screen, and press Enter. It doesn't matter where on the bottom row, just anywhere, on the bottom row.
... |
Forum: C Jul 19th, 2008 |
| Replies: 11 Views: 1,314 I believe there are 2 sub cases when the user presses Enter:
1) If the cursor position is above (less than) the bottom row of the current screen (usually 25, but may be 43 or 50), then the cursor... |
Forum: C Jul 19th, 2008 |
| Replies: 9 Views: 691 This line of code is correct:
index_s1 = strlen(num_s1) - 1;
Without the " - 1" in there, you are going outside the bounds of the array. Arrays are zero based, so if the array has 12... |
Forum: C Jul 19th, 2008 |
| Replies: 12 Views: 3,287 This isn't the place for "can you tell me about some feature of C". This is *not* a lecture hall, and we don't have the time to be unpaid tutors.
You have to remember, there are a *lot* of... |
Forum: C Jul 19th, 2008 |
| Replies: 5 Views: 3,407 When you run a program and the first choice shows nothing, it's safe to say it's lacking! :)
I re-worked Choice A, but the answer is being written out in reverse. You need to take the digits and... |
Forum: C Jul 18th, 2008 |
| Replies: 38 Views: 2,428 Every student of C should know that scanf() is very "fragile" and should only be learned because it's a part of the language, and every book on C seems to use it.
scanf() should thereafter *never*... |
Forum: C Jul 18th, 2008 |
| Replies: 8 Views: 640 You need to write down your ATM options on each scrren, before you can program anything meaningful.
Welcome - Please Enter Your ATM Card, and Your PIN.
Then:
Options:
1) Withdraw Cash 2)... |
Forum: C Jul 18th, 2008 |
| Replies: 38 Views: 2,428 This is incorrect:
fprintf(strea, "%s %s %d %s",&name[10],&course_enrolled[10],&id_number,&date_of_birth[10]);
Try:
fprintf(strea, %s %s %d %s", name[i], course_enrolled[i],... |
Forum: C Jul 18th, 2008 |
| Replies: 38 Views: 2,428 You've opened the file for reading, not writing, and your fprintf line is wrong. Do it like this:
//example for writing to a file
int main(void)
{
FILE *stream;
int i = 100;
char c... |
Forum: C Jul 17th, 2008 |
| Replies: 4 Views: 2,926 It looks like you're solving for the number of permutations, rather than combinations (which are far fewer). Can you confirm which it is?
Giving your variables better names than: nfact, kfact,... |
Forum: C Jul 17th, 2008 |
| Replies: 9 Views: 713 Just
system("sample");
in a loop, will do. You may need to add a sleep(# of seconds) statement, before the next loop, so your bat file will have time to run, before the next call to run it.
... |
Forum: C Jul 17th, 2008 |
| Replies: 38 Views: 2,428 No, I'm not going to try and run your code to find out what the problem(s) may be. I'm going to wait for you to tell me what *specific* problem(s) you have found with the program.
It is your... |