Search:

Type: Posts; User: zmaker5

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    10
    Views
    1,114

    even with your slash (which I removed after...

    even with your slash (which I removed after running when I noticed it) didn't seem to throw anything off since it took it as an escape command and so \- only took up one space in the alphabet array...
  2. Replies
    10
    Views
    1,114

    ah thanks guys dunno why I didn't think to just...

    ah thanks guys dunno why I didn't think to just make an array for the returns, but now I'm having a little problem, I'm trying to add a fix or de-"glitching" function that compares a spot versus its...
  3. Replies
    10
    Views
    1,114

    that's what I mean, does the return halt the...

    that's what I mean, does the return halt the switch and pull the program out of the function?

    switch(1)
    return 1;
    switch(2)
    return 2;

    will that work is what I'm double checking, I'll...
  4. Replies
    10
    Views
    1,114

    with a switch though will return break or will I...

    with a switch though will return break or will I need return than break. I know return is supposed to exit the function but I haven't used switches in functions yet so I just wanted to make sure.
  5. Replies
    10
    Views
    1,114

    implementation question

    well I managed to pull this one off on my own, but I was wondering if for my conversion function a switch might be a better way of doing it.

    The program takes a text file of 20x30 digits and...
  6. Replies
    15
    Views
    4,676

    ok it's working now though could someone explain...

    ok it's working now
    though could someone explain to me why changing it from i = 0 to i = 1 fixed it? thanks


    #include <stdio.h>
    #include <stdlib.h>
    #define MAX 100

    int main(void)
    {
  7. Replies
    15
    Views
    4,676

    ok new problem, now all it does is print out the...

    ok new problem, now all it does is print out the first line of any file minus the first character, no matter what is input for lines

    new code

    #include <stdio.h>
    #include <stdlib.h>
    #define...
  8. Replies
    15
    Views
    4,676

    alright I've got the program relatively working...

    alright I've got the program relatively working in terminal, part of the problem was fgets was grabbing the \n at the end of entry (dunno why I keep forgetting about that)

    thanks for your help guys
  9. Replies
    15
    Views
    4,676

    ok changed to #include #include...

    ok changed to


    #include <stdio.h>
    #include <stdlib.h>
    #define MAX 100

    int main(void)
    {
    int i = 0, line, check;
  10. Replies
    15
    Views
    4,676

    yeah I change it to stdout and it works just the...

    yeah I change it to stdout and it works just the same (even if I test with fake file names with stdin and stdout.)

    I originally was going to use a for loop and then thought a while loop would be...
  11. Replies
    15
    Views
    4,676

    fgets(words, 100, fp) is supposed to fill it, but...

    fgets(words, 100, fp) is supposed to fill it, but since it only reaches that after EOF it's not going to put anything.

    I have even changed the code to

    #include <stdio.h>
    #include <stdlib.h>...
  12. Replies
    15
    Views
    4,676

    I've also tried changing the if(check == '\n') to...

    I've also tried changing the if(check == '\n') to
    if(check == '\0')
    if(check == '\r')
    if(check == ' ')
    if(check == 32)
    if(check == 't')

    and still no change
  13. Replies
    15
    Views
    4,676

    doesn't stop before EOF

    Enter a filename, enter a number, and the program is supposed to get to that "line" and print it then exit. My plan to accomplish this was count newlines (i < lines) or until EOF and then print a...
  14. Replies
    5
    Views
    1,332

    that fixed it thanks, I figured that an EOF would...

    that fixed it thanks, I figured that an EOF would always come right after a \n or \0 etc. bad assumption I guess. Thanks again guys
  15. Replies
    5
    Views
    1,332

    my C book says macintosh saves text files with \r...

    my C book says macintosh saves text files with \r at the end of lines (granted the book is old so maybe in OS X they may have changed it) and the 1000 MAX shouldn't be a problem since both files...
  16. Replies
    5
    Views
    1,332

    Segmentation error

    So I run this in the terminal, give it two filenames and I get a segmentation error, basically it's supposed to open two files, and print a line from file1 then print a line from file2 until an EOF. ...
  17. Replies
    3
    Views
    1,251

    doh! right because it's a pointer it's already...

    doh! right because it's a pointer it's already an address, thanks
  18. Replies
    3
    Views
    1,251

    quick pointer question

    ok so I'm refreshing myself on pointers real quick, I thought I could directly pass the address of a variable to a function and not have to pass it a pointer, am I wrong? But the only way I've...
  19. Thread: broken switch?

    by zmaker5
    Replies
    11
    Views
    1,556

    aye I had it working with "q" for ending and...

    aye I had it working with "q" for ending and such, just the exercise I'm doing called for EOF, I guess so later maybe it will want me to convert the program to work with files not sure. But I assume...
  20. Thread: broken switch?

    by zmaker5
    Replies
    11
    Views
    1,556

    mmmk added that in and declared a char c,...

    mmmk added that in and declared a char c, resulted in


    [Session started at 2007-07-29 17:23:10 -0400.]
    Input up to 1000 characters
    afafas
    fasf
    asfas
     (entered an EOF...
  21. Thread: broken switch?

    by zmaker5
    Replies
    11
    Views
    1,556

    I'm not sure what you're asking, it skips right...

    I'm not sure what you're asking, it skips right down to invalid input before even doing a scanf (far as I can tell) and also I'm running this with stdin instead of from a file so maybe it's grabbing...
  22. Thread: broken switch?

    by zmaker5
    Replies
    11
    Views
    1,556

    -just fixed that- sorry forgot to show that...

    -just fixed that- sorry forgot to show that correction, I noticed that when I was typing up the thread and forgot to fix it in the post after fixing it in my file. That was causing quitting but not...
  23. Thread: broken switch?

    by zmaker5
    Replies
    11
    Views
    1,556

    broken switch?

    Ok this seems fine except once it reaches the switch it prints "invalid input" before anything had been entered and just sits there, doing nothing no matter what is entered.

    basically just...
  24. Replies
    9
    Views
    1,622

    if (strcmp("\0", ptr) == 0) printf("\n%s not...

    if (strcmp("\0", ptr) == 0)
    printf("\n%s not found in %s\n", ins, fit);
    else
    printf("\n%s found in %s ||\t %c %p\n - - - - - -\n", fit, ins, ptr, ptr);

    Right here are the two...
  25. Replies
    9
    Views
    1,622

    ok I get what you're saying, and the -1 won't be...

    ok I get what you're saying, and the -1 won't be dangerous if I use a few if statements after string_in is called, but still why is it crashing when I leave in the "if ptr is null" section?
Results 1 to 25 of 40
Page 1 of 2 1 2