Search:

Type: Posts; User: someprogr

Page 1 of 3 1 2 3

Search: Search took 0.02 seconds.

  1. Replies
    2
    Views
    869

    Basic Typedef question

    Whats the difference between doing:


    typedef struct myStruct {

    int a;
    int b;
    };

    and
  2. Replies
    5
    Views
    2,472

    sprintf issue

    I'm trying to write a basic function that converts a 6 byte array to a formatted mac address string:

    i.e. 0x12 0x13 0x14 0x15 0x16 0x17

    would be formatted to:

    12:13:14:15:16:17

    The code I...
  3. Replies
    1
    Views
    1,842

    Better ANSI keyboard handling?

    Hello,

    I am writing a command prompt program in C but am having issues with the current i/o functions that ANSI C provides. I am currently using gets() and scanf(), but they can't take...
  4. Replies
    4
    Views
    1,822

    Hex String to Decimal Possible?

    Hello, I have a program that takes input from a user with gets(). Basically, the user is going to input a hexidecimal number. I will need to convert that number to an int because its going to have to...
  5. Replies
    6
    Views
    10,224

    An array of macro functions?

    I have a program which currently calls functions that are located in an array of function pointers. I have to use this method because there are hundreds of functions and which ones to be called can...
  6. Replies
    4
    Views
    1,985

    if I change myfile.c to: #include ...

    if I change myfile.c to:


    #include <stdio.h>

    extern struct mystruct
    {
    char a;
    char b;
    } ab;
  7. Replies
    4
    Views
    1,985

    extern doesnt go well with structs?

    Consider the following:

    myfile.c


    #include <stdio.h>

    extern struct mystruct ab;

    int main()
  8. Replies
    3
    Views
    1,215

    typedef problem

    Hello, I have 3 header files and 1 .c file.

    The .c file #includes both header files.

    In the 2 header files, there are extern definitions of of a struct:

    header1.h:


    #include "types.h"
  9. Replies
    11
    Views
    1,695

    How are structs initalized to zero?

    I have a struct declaration in a header file:


    // myheader.h:

    struct testStruct
    {
    char myChar;
    int myInt;
    char array[200];
  10. Replies
    6
    Views
    1,318

    testVar is defined in test.c in the main()...

    testVar is defined in test.c in the main() function as indicated above

    char testVar = 'a';
  11. Replies
    6
    Views
    1,318

    I'm using: root@c64:/root/testarea# gcc test.c...

    I'm using:

    root@c64:/root/testarea# gcc test.c test.h
  12. Replies
    6
    Views
    1,318

    global var problems

    Hello, I've come across an interesting problem I haven't had before.

    Here is an example:

    I have a variable called testVar which should be available to any .c file that #includes test.h. For...
  13. Replies
    2
    Views
    1,392

    Best way to get miliseconds?

    Whats the best way to get the current time in milliseconds for C? Time.h seems to have only stuff for hours:minutes:seconds.

    I ask because I am trying to emulate a CPU which is significantly...
  14. Replies
    7
    Views
    1,611

    MK27, Maz: & wont work because if the 7th bit...

    MK27, Maz:

    & wont work because if the 7th bit of val is 1 and we & that with reg which 7ths bit is 0, the resulting value of reg would be 0. I need it to be 1.
    | wont work either because if the...
  15. Replies
    7
    Views
    1,611

    Stumped by bitwise calc

    Heres a test program:


    #include <stdio.h>

    int main()
    {
    unsigned char reg = 128;
    char val = 6;
  16. Replies
    4
    Views
    11,921

    pointer to first element in array

    Hello, I have a very basic question, and this doesn't seem to be working for me:

    Heres a test code:


    #include <stdio.h>

    int main()
    {
    unsigned char *myptr;
  17. Replies
    8
    Views
    23,712

    well from my understanding *ptr2 has to point to...

    well from my understanding *ptr2 has to point to a char * pointer type and so i pointed it at ptr because thats exactly what it is: a char * pointer.

    Same for ptr2... **ptr2 points to a 32-bit...
  18. Replies
    8
    Views
    23,712

    triple pointers *** question

    Hello, I'm writing a program that will be utilizing triple pointers but for some reason my test program isn't working as it should:


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

    int main()
    {
    ...
  19. Replies
    5
    Views
    1,389

    How to test algorithms?

    Hello,

    I am in the process of writing functions and such, but I need to know how efficient different algorithms are. Disassembling these functions just tells me the assembly code used, but I...
  20. I'll try that, thanks

    I'll try that, thanks
  21. Anyone good with bitwise operations/page detection

    I am having difficulty determining whether or not two addresses are on the same page. First let me define a page.

    A page is an area in memory that is 255 bytes. The first page (or called zero...
  22. Replies
    8
    Views
    3,624

    oh ok. thanks

    oh ok. thanks
  23. Replies
    8
    Views
    3,624

    actually, wouldnt shifting it to the right and...

    actually, wouldnt shifting it to the right and isolating it be faster? i.e. i = var1 >> 7
  24. Replies
    8
    Views
    3,624

    Bitwise Questions

    I'm trying to optimize my code and I have two bitwise questions:

    I have a variable i. I am running a bitwise operation. If var1 = 0, then i = 1, if var1 = any other number, then i = 0. Would this...
  25. Replies
    13
    Views
    6,304

    ahhhh that did it thanks!

    ahhhh that did it thanks!
Results 1 to 25 of 52
Page 1 of 3 1 2 3