Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.24 seconds.

  1. Replies
    2
    Views
    65

    How about copy/pasting the text of your...

    How about copy/pasting the text of your assignment.

    Instead of a bunch of questions around what you imagine the problem/solution might be.
  2. > First of all, you cannot assume the order of...

    > First of all, you cannot assume the order of the members of a struct, in memory, despite the order you specify.
    Erm, yes you can.
  3. Looks like you didn't learn the lesson from last...

    Looks like you didn't learn the lesson from last time.

    Just do yourself a favour and stop digging these huge holes for yourself.


    $ gcc -Wall main.c
    main.c: In function ‘ProcessUser’:...
  4. Replies
    3
    Views
    182

    > Is it mean that we have a pointer that points a...

    > Is it mean that we have a pointer that points a struct with slots x,y,w,h,flags?
    > Do we need to define these kind of pointers like pointer to int or pointer to float?
    Let's illustrate your...
  5. Replies
    3
    Views
    147

    if ( sscanf(buff, "width %d - %*d,%*d,%d", &n1,...

    if ( sscanf(buff, "width %d - %*d,%*d,%d", &n1, &n2) == 2 )

    This will ignore lines not matching the expected format.
  6. Replies
    3
    Views
    147

    Use fgets() to read a whole line into memory. ...

    Use fgets() to read a whole line into memory.

    Then perhaps


    char buff[BUFSIZ];
    fgets(buff,BUFSIZ,f1);
    sscanf(buff, "width %d - %*d,%*d,%d", &n1, &n2);
  7. Replies
    3
    Views
    201

    No information? ...

    No information?

    http://www.libpng.org/pub/png/libpng-manual.txt

    There's a similar set function as well.
  8. Replies
    4
    Views
    232

    Add in a line somewhere like if ( i != 2 )

    Add in a line somewhere like

    if ( i != 2 )
  9. Replies
    4
    Views
    232

    Are you looking to just not print the second row,...

    Are you looking to just not print the second row, or are you trying to create a new new int[3, 6]; ?
  10. Replies
    2
    Views
    197

    > I'm trying to return a double pointer from a...

    > I'm trying to return a double pointer from a function. Here is my current code:
    But you have a 2D array - which isn't the same thing.

    char a[N] becomes a char *
    but
    char a[R][C] becomes char...
  11. int **n You can synthesise any n[x][y] kind of...

    int **n
    You can synthesise any n[x][y] kind of array, and each y can be different (ragged)


    n = malloc(x*sizeof(*n));
    for(i = 0 ; i < x ; i++)
    n[i] = malloc(y*sizeof(*n[i]));


    int *n[3]
  12. Replies
    1
    Views
    185

    Wow ... Fix all these first. $ gcc -Wall...

    Wow ...

    Fix all these first.


    $ gcc -Wall -Wextra main.c
    main.c:24:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
    void main()
    ^
    main.c: In function ‘main’:
  13. Replies
    54
    Views
    1,095

    If it's a botched attempt to tell you a signal...

    If it's a botched attempt to tell you a signal number, then 11 would indicate a segmentation fault.
  14. It was half an answer (aka a hint) to see how far...

    It was half an answer (aka a hint) to see how far you could then go by yourself.

    Apparently, not that far.

    Post your effort, not "I tried ... and it didn't work".
  15. It depends how complicated your expressions are....

    It depends how complicated your expressions are.

    Given your examples, a simple


    int n1, n2;
    char op;
    if ( sscanf(output,"%d%c%d",&n1,&op,&n2) == 3 ) {
    if ( op == '+' )
    }
  16. Replies
    1
    Views
    193

    Lookup isprint() in ctype.h

    Lookup isprint() in ctype.h
  17. Replies
    3
    Views
    243

    Well somewhere, you need to initialise your key...

    Well somewhere, you need to initialise your key string.
    char key[] = "hello";

    Then you need an index and a count.
    int key_index = 0;
    int key_count = 5;


    > If (keyIsNotExhaust) Encryption =...
  18. Replies
    11
    Views
    501

    > Is this how it would happen to encrypt and...

    > Is this how it would happen to encrypt and decrypt?
    Have you tested it?

    At some point, you'll have been given some example inputs and expected outputs.
  19. Sure is. #include #include...

    Sure is.


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

    typedef struct {
    int bar;
    } foo_st;
  20. Replies
    11
    Views
    501

    Right, so you need several things. 1. Your key...

    Right, so you need several things.

    1. Your key needs a size.
    char key[100];

    2. Whenever you write a single char to the array, you need a subscript.
    key[some_integer_counter] = k;

    3. If you...
  21. Replies
    6
    Views
    268

    Following on from your previous post. Reading...

    Following on from your previous post.
    Reading bmp file to 2d array

    You read in a BMP into a 2D array of pixels.

    You modify some of those pixels in some way.

    You write out a BMP to a new...
  22. Thread: asn.1

    by Salem
    Replies
    1
    Views
    208

    > I have a confuse with relation between C and...

    > I have a confuse with relation between C and asn.1
    There isn't one.

    C is a programming language.
    ASN.1 is an IDL - Interface Description Language ( ASN.1 - Wikipedia )

    To be specific:
    C is...
  23. Replies
    11
    Views
    501

    Well first, decide whether your global variable...

    Well first, decide whether your global variable 'key' is a single char, or an array of chars.
  24. > My task is to create a primitive array of...

    > My task is to create a primitive array of objects belonging to my 'Planet' class that is not shown here.
    Well without it, it's impossible to say what could possibly make sense of your assignment....
  25. Replies
    3
    Views
    248

    Get out the paper and pencil, and doodle. You...

    Get out the paper and pencil, and doodle.

    You logically have three temporary pointers which follow each other down the linked list (called Prev, Curr and Next).


    .
    P C ...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4