Search:

Type: Posts; User: stumpster123

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,280

    Don't you need to cast the first parameter to...

    Don't you need to cast the first parameter to (const void *) in fwrite.
  2. Replies
    5
    Views
    2,999

    Oh boy I am sorry, definately should have done...

    Oh boy I am sorry, definately should have done that. I fixed it here.


    #include <stdio.h>
    #define MASK 0x80000000

    int main()
    {
    int x, t, i;
    for(x =1; x <= 256; x++)
  3. Replies
    22
    Views
    1,830

    This is a good beginner tutorial it has basics on...

    This is a good beginner tutorial it has basics on classes and file I/O

    Tutorial
  4. Replies
    10
    Views
    1,280

    You would need a hash function too, that will...

    You would need a hash function too, that will generate the key.
    Here is a good hash function


    int hash_example (char *s, int T)
    {
    int h = 0;
    for (; *s != 0; s++)
    h = (h << 5) ^ (*s)...
  5. Replies
    22
    Views
    1,830

    Yeah that's my biggest question why does it...

    Yeah that's my biggest question why does it matter what the name of the class. If a user is using a program he doesn't need to know the details like the name of a variable or a class. I mean maybe...
  6. Replies
    22
    Views
    1,830

    I Don't understand why you would want to do that....

    I Don't understand why you would want to do that. Is there a specific reason?
  7. Replies
    7
    Views
    1,123

    He means if you divide by 0 your program will...

    He means if you divide by 0 your program will crash. Try going from 1 to 7 or something by incrementing fight after it is generated.
  8. Replies
    5
    Views
    2,999

    You could do this too, #include...

    You could do this too,




    #include <stdio.h>
    #define MASK 0x00000001

    int main()
    {
  9. Replies
    8
    Views
    3,167

    Yeah I was just too lazy to look it up but it...

    Yeah I was just too lazy to look it up but it still wouldnt fit
  10. Replies
    8
    Views
    3,167

    Well thats the problem there are no data types...

    Well thats the problem there are no data types that can fit numbers that large especially double. I know there is a quad type, which is 128 bits, but its only for special machines and i dont even...
  11. Replies
    8
    Views
    3,167

    I don't know of any data type that can hold a...

    I don't know of any data type that can hold a value as large as 5e60 that is a gigantic number and a double will never be able to hold that it goes to like 2e9 about. Maybe you could just take away...
  12. Replies
    4
    Views
    1,143

    you should write a function to insert each node...

    you should write a function to insert each node into the list. If you want to insert into the front of the list it isnt too hard. Heres some pseudocode.


    void new_node(struct list ** pHead, ...
  13. Replies
    3
    Views
    1,326

    Well fseek just moves around the file pointer you...

    Well fseek just moves around the file pointer you would still need to use fscanf or fread to read in the integer.
  14. Replies
    3
    Views
    1,478

    Try using this call instead ...

    Try using this call instead


    student::readfile(filename, &ctr, ARRAY);
  15. Replies
    6
    Views
    1,570

    Well when you use fscanf with a char array u can...

    Well when you use fscanf with a char array u can just send the variable not the address.

    fscanf(f, "%s", line);
    That will only read until it reaches white space so Fri will be put into line.
    ...
  16. Replies
    4
    Views
    1,226

    Easy if you want to print an integer in...

    Easy if you want to print an integer in hexadecimal you don't need to use any function just use printf with the %x flag as follows.


    printf("%x\n", int);

    If you want to convert it from binary...
  17. Replies
    9
    Views
    1,100

    I would say you can't do this because it is a...

    I would say you can't do this because it is a function not a data type and is not accessed like a data type.
  18. Replies
    1
    Views
    699

    You can type cast the variable to an int or just...

    You can type cast the variable to an int or just save it to an integer variable for example.


    (int)charvariable
    int iVar = cVar;

    The only problem with that is when the char is representing...
  19. Replies
    10
    Views
    2,250

    Yea but remember a string is an array of...

    Yea but remember a string is an array of characters so technically it is a 2d array still. Even though it is malloced and not a specified length to begin with you would still access a single char...
  20. Replies
    10
    Views
    2,250

    You are going to have to use a 2 dimension array...

    You are going to have to use a 2 dimension array to do that.
    Because if you think about it the array of strings is also a 2 dimensional array also it is just initialized differently.
  21. Replies
    4
    Views
    1,273

    Thanks dave that worked perfectly.

    Thanks dave that worked perfectly.
  22. Replies
    4
    Views
    1,273

    Yeah that is what read info is doing before it...

    Yeah that is what read info is doing before it reads anything. It opens the file and uses the file pointer that is sent from main function. I am using an array so the function call is in a for loop...
  23. Replies
    4
    Views
    1,273

    Passing array member as a parameter

    In my main function I have an array of File pointers like this:


    FILE *fInfile[MAXFILE]

    and my functions header is


    int read_info(FILE *fA, FILE *fI);
    {
  24. lol got back to the post too slow otherwise I...

    lol got back to the post too slow otherwise I would have posted it. Don't worry i can do it but quzah beat me to the punch.
  25. Ok i see sorry i read the initial question wrong....

    Ok i see sorry i read the initial question wrong. You want to break the list in half where the even nodes go into on sublist and the odd go into another. This can be done like this

    for(i = 0;...
Results 1 to 25 of 26
Page 1 of 2 1 2