Search:

Type: Posts; User: nasser

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,992

    Ah, thanks.

    Ah, thanks.
  2. Replies
    2
    Views
    1,992

    conditional operator

    When I try to do:


    access_type > 0 ? modified = 1: modified = 0;

    I get the error "Lvalue required as left operand of assignment".

    I tried to follow the standard form: (a > b) ? (c = x ) :...
  3. Replies
    5
    Views
    857

    thanks for the link...looks like theres plenty to...

    thanks for the link...looks like theres plenty to learn :/
  4. Replies
    5
    Views
    857

    I see, but why would you need a pointer to a...

    I see, but why would you need a pointer to a function? :s

    Couldn't you just create a function prototype for print_data_func and call it like normal??
  5. Replies
    5
    Views
    857

    question on syntax

    void search_list(datalist_t *list, int key,
    void (*print_data_func)(void*))
    {

    datalist_t *p;

    p = list;
    while (p != NULL ) {

    if (p->item_key == key ) {
  6. Replies
    10
    Views
    987

    One more question, how can I assign a pointers...

    One more question, how can I assign a pointers value into an array i.e

    where printArray is a pointer to a char got from a function. This doesn't seem to work:



    for(i=0; i<10;i++) {
    ...
  7. Replies
    10
    Views
    987

    AndrewHunters suggestion worked, thanks.

    AndrewHunters suggestion worked, thanks.
  8. Replies
    10
    Views
    987

    I tried that, when I do: ...

    I tried that, when I do:


    printf("\n\nbit_pattern: %s\n\n", bit_pattern[1][1]);

    I get: bit_pattern: 01010110011110001001101010111100110111101111, which is basically some combination of the...
  9. Replies
    10
    Views
    987

    multi string arrays

    Hi

    If I have:


    char bit_pattern[][4][4] = {
    "0000", "0001", "0010", "0011",
    "0100", "0101", "0110", "0111",
    "1000", "1001", "1010", "1011",
    "1100", "1101", "1110", "1111"};
  10. Thread: hex to binary

    by nasser
    Replies
    13
    Views
    2,303

    I initialised it like: char binary[50] = {0}...

    I initialised it like:
    char binary[50] = {0} at the start of main. Is this right?
  11. Thread: hex to binary

    by nasser
    Replies
    13
    Views
    2,303

    Why won't it be overloaded? I actually tried it...

    Why won't it be overloaded? I actually tried it and it does.

    You defined binary as binary[128], each hex number takes 32 bits/elements, so after a few inputs it will fill up the array.
  12. Thread: hex to binary

    by nasser
    Replies
    13
    Views
    2,303

    ^Thanks for that. But can you see I will have...

    ^Thanks for that.

    But can you see I will have the problem where the binary string will be overloaded after a few inputs?
    The binary doesn't have to be a character string btw. I want to later...
  13. Thread: hex to binary

    by nasser
    Replies
    13
    Views
    2,303

    The problem here is that the character array...

    The problem here is that the character array binary gets overloaded because I am reading in multiple (unknown) number of hex numbers.
    I also have the problem of not knowing how many inputs there are...
  14. Thread: hex to binary

    by nasser
    Replies
    13
    Views
    2,303

    hex to binary

    Hi

    I am looking for a way of converting a hex string into binary, or at least somehow separating the bitfields using masking, shift operators or some other method. I came up with a way of manually...
  15. Replies
    4
    Views
    871

    Genius. thank you:)

    Genius. thank you:)
  16. Replies
    4
    Views
    871

    i've also tried putting "%*c" in front of "%d",...

    i've also tried putting "%*c" in front of "%d", but doesn't work for me.
  17. Replies
    4
    Views
    871

    Discarding input

    Hi

    if I have an input in the form: (character)(number)=(number) i.e a7=5.

    How would you put it in scanf form?

    I've tried:


    scanf("a%d=%d", &getchar, &getnum) == 2
  18. Replies
    10
    Views
    911

    Actually I think I figured it out. I think I'll...

    Actually I think I figured it out. I think I'll use a scanf inside an If statement to see if the input is in the form I want. Scanf will return 1 if the input is in correct form, or 0 if its a...
  19. Replies
    10
    Views
    911

    can you explain how that line addresses my...

    can you explain how that line addresses my problem? how does it work?

    i'd prefer someone else answer.
  20. Replies
    10
    Views
    911

    Could you be more specific? Maybe a sample code...

    Could you be more specific? Maybe a sample code...
  21. Replies
    10
    Views
    911

    Actually my bad, I changed the question slightly,...

    Actually my bad, I changed the question slightly, didn't know it would make a difference.

    Say the binary is really a hex number i.e Bi = 1A596317. So they all have 8 bits.

    OK, but if you put a...
  22. Replies
    10
    Views
    911

    Searching strings

    Hi

    I have a particular problem where I need to feed two types of inputs into my program, a hex number and a binary number.

    Example of input:

    Binary
    Bi = 1100100
    Bi = 0110101
    Bi = 0101100
  23. Thread: assembly

    by nasser
    Replies
    5
    Views
    987

    ok thanks

    ok thanks
  24. Thread: assembly

    by nasser
    Replies
    5
    Views
    987

    Determining the instruction type is the easy...

    Determining the instruction type is the easy part, as you just look at the first 6 bits(opcode). I need help with parts 2 and 3.
  25. Thread: assembly

    by nasser
    Replies
    5
    Views
    987

    assembly

    I have a C assignment where, to summarise, the inputs are assembly instructions(mips) in the form of a hexadecimal number and the program must:

    1. determine if the instruction is a "load" or...
Results 1 to 25 of 30
Page 1 of 2 1 2