Search:

Type: Posts; User: kal123456

Search: Search took 0.01 seconds.

  1. I JUST DID THAT AND IT WORKED!!! thanks so much!!...

    I JUST DID THAT AND IT WORKED!!! thanks so much!! :)
  2. so would i do something like this? int...

    so would i do something like this?


    int num_rows = namesArray[0][0];


    since the first row and column of the array is 16 in this case? the teachers doesnt really want us to output the number...
  3. @AndiPersti Thanks, I actually got my program to...

    @AndiPersti Thanks, I actually got my program to print the table correctly! the only problem is that now I want the first element of the array not to be read...for example, the names.txt file looks...
  4. Ohh ok, that makes sense that i would rather use...

    Ohh ok, that makes sense that i would rather use what I already defined then creating new integers, thanks! and I fixed up my code, I made the getSales function look exactly like the getNames...
  5. Ok, i'll indent it right now! and in the...

    Ok, i'll indent it right now!
    and in the getSales function, i wrote:

    int col=6;
    int row=25;


    so i made the max number of columns be 6, and the mas number of rows 25. I also defined...
  6. I'm really sorry that I'm speeding through this,...

    I'm really sorry that I'm speeding through this, but it's due by today midnight, and I'm just really nervous -___- Thanks for clearing the fgetc thing out! I'm using that in my code now, so the...
  7. Oh, and also, I'm not allowed to use strings when...

    Oh, and also, I'm not allowed to use strings when I read the names....Im supposed to read in one character at a time...
  8. @Matticus -- Yes, i just read the link!! I tried...

    @Matticus -- Yes, i just read the link!! I tried doing what it said in the link, but my code got all messed up, so I'm trying to see if nonpuz's way will work....I'm so confused!!

    @nonpuz -- I...
  9. no it doesnt!! i had to add what @camel-man...

    no it doesnt!! i had to add what @camel-man suggested,
    if(namesArray[i][j]==',') printf("\n");

    However, now it outputs a slightly different output, the commas are misarranged!! it looks like...
  10. ya im on a windows machine and here's my code: ...

    ya im on a windows machine and here's my code:



    #include <stdio.h>

    #define INPUT_FILE_GET_NAMES "names.txt"
    #define INPUT_FILE_GET_SALES "sales.txt"
    #define MAX_ROWS_NAMES 25
    #define...
  11. OMG.........it actually works!!!! only now, the...

    OMG.........it actually works!!!! only now, the last problem, how do I get it to look exactly like the txt file? like this:



    16
    Kelly, Victor
    Lam, Gary
    Nagasake, David ...
  12. Ohh ok, so I changed the %d to %c which means...

    Ohh ok, so I changed the %d to %c which means that now it should be printing characters instead of integers. However, now it doesn't output anything, just a blank space haha.....what do you mean by...
  13. Ohhh, so then how do i change it to read...

    Ohhh, so then how do i change it to read characters?
  14. ok now i get it to print something, but instead...

    ok now i get it to print something, but instead of printing out the contents of the txt file, it just prints:


    0000000000000000000000000
    Process returned 0 (0x0) execution time : 0.055 s...
  15. Ohh ok! I don't think I'm gonna make one function...

    Ohh ok! I don't think I'm gonna make one function do the same 2 things, cause my teacher prefers us to write 2 separate functions, but thanks for letting me know, i'll use it in the future! so I just...
  16. OMG thanks so much for clearing that out! and...

    OMG thanks so much for clearing that out! and actually, I changed up the parameters a bit, so now there's only one parameter, and I changed the way I open my file, similar to the pseudocode you...
  17. I just removed the second parameter from the...

    I just removed the second parameter from the getNames function, now my code looks like this and it will run and then crash....PLEASE HELP!!



    #include <stdio.h>

    #define INPUT_FILE_GET_NAMES...
  18. ok so i'm trying to make a separate function that...

    ok so i'm trying to make a separate function that will read from a txt file into a 2D array...somehow it's not working :( it keeps on saying that "filename" is undeclared....help please, thanks!!

    ...
  19. yeah could you please give more details? thanks!!...

    yeah could you please give more details? thanks!! :)
  20. @zw_hat Thanks for the great code!! I think i...

    @zw_hat Thanks for the great code!! I think i might use fgets then, it's probably easier haha! btw, in line 35 of your code, what are the ... ? :)
  21. 2Dimensional arrays..read from txt file PROBLEM! :O

    Hey everyone, so I have this following code, and what I'm supposed to do is this (assignment copied and pasted below):



    The following table shows the total sales for salespeople of the ABC...
Results 1 to 21 of 22