Search:

Type: Posts; User: 8ball

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    2,610

    basically what im trying to say is i dont know...

    basically what im trying to say is i dont know why it doesnt work when there are more than 1 line in my text.txt file
  2. Replies
    2
    Views
    2,610

    fwrite() looping...

    Im having trouble writing a loop for the fwrite functions of this code



    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>

    char upperbyte=0;
    char lowerbyte=0;
  3. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    and if i need to use those numbers in variables...

    and if i need to use those numbers in variables for binary conversion, will i need to make them int?
  4. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    this is what i have now, ive done a.. but dont...

    this is what i have now, ive done a.. but dont know how to b & c
    will i need to modify the while loop to get the 2 variables?



    #include<stdio.h>
    #include<string.h>
    #include<math.h>...
  5. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    ok now i want to make each line into 3 variables...

    ok now i want to make each line into 3 variables
    a,b,c

    for example
    if my line is LDC 1,2 #blah blah blah

    i want
    a = LDC
    b = 1
    c =2
  6. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    void breakup(char *pfile) ?

    void breakup(char *pfile)
    ?
  7. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    void breakup() { char buff[BUFSIZ]; ...

    void breakup()
    {
    char buff[BUFSIZ];

    while ( fgets( buff, BUFSIZ, pfile ) != NULL ) { /* read each line */
    char *sub_string;
    char *hash = strchr( buff, '#' ); /* is...
  8. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    thanks alot for that what would be the...

    thanks alot for that

    what would be the parameter if i want to place all that in a function?
  9. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    this is what my code looks like now #include...

    this is what my code looks like now


    #include <stdio.h>
    #include <string.h>
    char file_array[10000];


    /*void
    readfile(char *file)
  10. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    where do i place this?

    where do i place this?
  11. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    nope...

    nope...
  12. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    will i need linked lists?

    will i need linked lists?
  13. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    when my input is LDC 1,2 #444 LDC 1,2 #...

    when my input is
    LDC 1,2 #444
    LDC 1,2 # dkljdlkdj
    Print -4 #dldkdl;

    its giving me this output
    LDC
    1
    2
    LDC 1
  14. Thread: reading a file

    by 8ball
    Replies
    19
    Views
    2,382

    reading a file

    my text.txt file


    LDC 1,2 #444
    LDC 1,2 #444


    my program:
  15. Replies
    3
    Views
    1,617

    yes i know that but how do i break it up?...

    yes i know that
    but how do i break it up?
    should i use sscanf?
  16. Replies
    3
    Views
    1,617

    reading instructions

    i want to write a program that reads and convert instructions into some numbers like for example

    add 1,2
    subtract 4,2

    expected output is
    000100010002
    &
    000200040002
  17. Replies
    4
    Views
    1,537

    seg fault, core dump

    seg fault, core dump
  18. Replies
    4
    Views
    1,537

    fwrite program : how do i run this program?

    #include <stdio.h>

    int main() {
    FILE *sourceFile;
    FILE *destinationFile;
    char *buffer;
    int n;

    sourceFile = fopen("file.c", "r");
    destinationFile = fopen("file2.c", "w");
  19. Replies
    8
    Views
    9,258

    ok i think i've changed the scanf codes correctly...

    ok i think i've changed the scanf codes correctly now...


    #include <stdio.h>
    #include <stdlib.h>

    #define BUFSIZE 1000

    int main(int argc, char *argv[]) {
    long startLine, finishLine;
  20. Replies
    8
    Views
    9,258

    ok thanks but im really stuck on this one ...

    ok thanks
    but im really stuck on this one


    if(!(scanf("l%ld", &c) != 1 )){
    startLine = c;
    printError=0;
    }

    what do i do with the !(scanf ...
  21. Replies
    8
    Views
    9,258

    replacing scanf...

    friend told me scanf is bad and told me to i need fgets + sscanf to replace it


    this is what i have now


    if(scanf(",%ld", &c) != 1 )
    printError=1;
  22. Thread: print lines

    by 8ball
    Replies
    8
    Views
    2,486

    this is what i hav now /*open the file read...

    this is what i hav now

    /*open the file
    read input from user(input1, input2)
    while the current line count is less than input1
    read and discard this line from the file
    while the...
  23. Thread: print lines

    by 8ball
    Replies
    8
    Views
    2,486

    is this the right? FILE *fp input1=2;...

    is this the right?

    FILE *fp
    input1=2;
    input2=5;

    fp = fopen(argv[1],"r")
    while(count<input1);
    printf(fgets(Input, 1024, fp));
    while(count>input2);
  24. Thread: print lines

    by 8ball
    Replies
    8
    Views
    2,486

    actually the printing line im not so sure

    actually the printing line im not so sure
  25. Thread: print lines

    by 8ball
    Replies
    8
    Views
    2,486

    i hav varibles input1=2 and input2=5 and i want...

    i hav varibles input1=2 and input2=5 and i want to print lines 2 to 5 from a file
    is this the way to do it?
    fp = fopen(argv[1],"r")
    while (count>input1&&count<input2);
    printf(fgets(Input, 1024,...
Results 1 to 25 of 38
Page 1 of 2 1 2