Search:

Type: Posts; User: Hobo

Search: Search took 0.00 seconds.

  1. Replies
    20
    Views
    6,959

    Madeleine Abduction

    Hi
    I haven't posted here very often cause I tend to find the answers I'm looking for in other peoples posts and in the FAQs. So I hope you don't mind me highlighting this news item which some of you...
  2. Replies
    5
    Views
    1,156

    Just thought you might like to know your scanf...

    Just thought you might like to know your scanf should be


    scanf("%d%d%d", &first_number, &second_number, &third_number);

    hobo
  3. Replies
    14
    Views
    7,119

    My head is definitly on backwards today, I didn't...

    My head is definitly on backwards today, I didn't notice the jump in line numbers so disregard previous answer but you might want to post more code.
  4. Replies
    14
    Views
    7,119

    33: if ( fptr == NULL ) { 34- printf (...

    33: if ( fptr == NULL ) {
    34- printf ( "Unable to open \"%s\" to write.\n", argv[3] );
    --
    155- fprintf ( stdout, "%d\t%d\t%d\n", i+1, j+1, adjacency[i][j] );
    156: fprintf ( fptr,...
  5. Replies
    5
    Views
    1,361

    Sorry keep the inner do loop, my head must be on...

    Sorry keep the inner do loop, my head must be on backwards or something.
  6. Replies
    5
    Views
    1,361

    If you have declared name as: char name[40];...

    If you have declared name as:


    char name[40];

    Then it can only hold 39 chars, one char is needed for '\0' at the end of the string.
    Take away the inner do loop and make sure clrscr() is...
  7. Replies
    5
    Views
    1,361

    If I've got this right you want your code to keep...

    If I've got this right you want your code to keep prompting for input if the previous input was invalid. Also you want it to clear the previous input and start at the same place on the screen.
    If...
  8. Thread: Colors + terminal

    by Hobo
    Replies
    4
    Views
    1,248

    I can't speak for anyone else but I do, and I...

    I can't speak for anyone else but I do, and I usually find my answer there or by searching previous posts, hence the reason for the number of posts I have made being so small.

    hobo
  9. Thread: Djgpp

    by Hobo
    Replies
    20
    Views
    2,388

    I haven't used it in a while but once you compile...

    I haven't used it in a while but once you compile (Alt+F9) and then run (Ctrl+F9) you can view your programs screen output (if there is any) by pressing Alt+F5 and then press any key to return to the...
  10. Thread: Strcmp

    by Hobo
    Replies
    11
    Views
    1,493

    I take your point Prelude. It amazes me how...

    I take your point Prelude.

    It amazes me how many things that I've been taught are either not good practice or just plain wrong and I'm obviously not the only one, going by the numerous posts that...
  11. Thread: Strcmp

    by Hobo
    Replies
    11
    Views
    1,493

    linuxdude wrote You could do ...

    linuxdude wrote

    You could do

    while(!strcmp(str1,str2))

    which would mean the loop would keep going while the strings were equal.

    hobo
  12. Replies
    9
    Views
    4,491

    I get the impression the question is asking you...

    I get the impression the question is asking you to convert 'cups' to all three. eg

    if
    cups = 16
    then
    gallons = 1
    quarts = 4
    pints = 8

    and then print out the value of all three. Therefore...
  13. Thread: isdigit problem

    by Hobo
    Replies
    3
    Views
    1,189

    your call to scanf should be scanf("%s",...

    your call to scanf should be


    scanf("%s", row);

    no '&' is needed for a string.
    However what is there to stop the user from entering more than the allowed chars ie 4 + '\0'. Try using fgets if...
  14. Thread: New TO C!!!

    by Hobo
    Replies
    4
    Views
    1,110

    The answer you received was intended to help but...

    The answer you received was intended to help but it expected a little work on your part.
    Anyway, I'm not a raw beginner but I'm no expert either. So I'll only attempt to give you a short example.
    ...
  15. Replies
    3
    Views
    1,455

    for ( pass = 1; pass

    for ( pass = 1; pass <= 3 - 1; pass++ ) /* passes */
    for ( i = 0; i <= 3 - pass -1; i++ ) /* one pass */
    if ( strcmp( customer[i].lastname, customer[i+1].lastname ) == 1) {
    hold = customer[i];...
  16. Replies
    26
    Views
    2,733

    If you use mode "a" this defaults to a text file,...

    If you use mode "a" this defaults to a text file, the same as if you use "at". Therefore you've opened your binary file as a text file. You need to use "ab".

    I'm sure this is right but someone...
  17. Replies
    72
    Views
    8,292

    >Although we will all learn C, by our selves I...

    >Although we will all learn C, by our selves
    I understand what you mean but don't forget that if you all start off knowing nothing about C and albeit learning from each other, you should still...
  18. Thread: Just curious

    by Hobo
    Replies
    9
    Views
    1,568

    I don't think it would cause a problem but I had...

    I don't think it would cause a problem but I had to type:
    value,value,value,value,value<enter>

    without the commas I typed:
    value<enter>
    value<enter>
    value<enter>
    value<enter>
    value<enter>
  19. Thread: advice on feof()

    by Hobo
    Replies
    2
    Views
    1,686

    Thanks for your response, either way it produces...

    Thanks for your response, either way it produces the same results, but I can see why testing the return value of the read function is the better way to go.
    Thanks again.

    hobo
  20. Thread: advice on feof()

    by Hobo
    Replies
    2
    Views
    1,686

    advice on feof()

    I've written a program which sorts variable sized records on a binary file
    into customer number order. I'm using feof() to terminate my loops, which
    works and I get the required results. I'm just...
  21. Thread: Just curious

    by Hobo
    Replies
    9
    Views
    1,568

    >f=float average(a,b,c,d,e); your function...

    >f=float average(a,b,c,d,e);

    your function returns a float but f is a double, and you have 'float' in front of the call to the function, can you do that?

    not sure about the scanf thing,
    does ...
Results 1 to 21 of 21