Search:

Type: Posts; User: elrookie

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,129

    re:

    #define <stdio.h>

    main()
    {
    char my_string[40];
    my_string[0] = 'T';
    my_string[1] = 'e';
    my_string[2] = 'd';
    my_string[3] = '\0';
    printf("&#37;s", my_string);
  2. Replies
    8
    Views
    1,129

    re:

    yes I am
  3. Replies
    8
    Views
    1,129

    string, arrays

    i am trying to learn about strings,
    how come when i compile this i get an error that states:

    macros names must be indentifiers



    char mystring[40];
    my_string[0] = 'T';
    ...
  4. Thread: question

    by elrookie
    Replies
    6
    Views
    1,119

    re:

    ohhh thanks guys now it works... !
  5. Thread: question

    by elrookie
    Replies
    6
    Views
    1,119

    re:

    #define NUMBER '0'

    void push(double);
    double pop(void);
    int getop(char[]);
    int getch(void);
    void ungetch(int);
  6. Thread: question

    by elrookie
    Replies
    6
    Views
    1,119

    question

    here is a



    */
    * reverse polish calculator
    */

    #include <stdio.h>
    #include "calc.h" /* header file */
  7. Replies
    13
    Views
    2,083

    "while" question

    # include <stdio.h>

    main()

    {
    int c, n1;
    n1 = 0;
    while (( c = getchar()) != EOF)
    if ( c == '\n')
    ++n1;
  8. Thread: question

    by elrookie
    Replies
    2
    Views
    931

    question

    I am getting introduced to pointers and i was reading this intro.



    #include <stdio.h>

    main()
    {
    int x = 7 ;
  9. Replies
    8
    Views
    5,736

    re:

    thank you for your suggestions! a lot

    I have a question about this piece of code:



    char hexdigits[] = "0123456789ABCDEF";
    hexstring[index++] = hexdigits[m];
  10. Replies
    8
    Views
    5,736

    re:

    sorry for the screw up code,

    can't use printf because it is not allowed.



    int itox( char hexstring[], int n) { /* takes in an integer n */
    int m, b, flag;
    b = (m / 16); ...
  11. Replies
    8
    Views
    5,736

    Binary to Hex Conversion

    Dear friends, I am trying to write a function that will convert an integer to a hex string. I would like to use the switch method. The code below is my work in progress, the logic i'm trying to...
  12. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    re:

    you are right looking at the arguments that getline() accepts and looking at what i'm passing confuses the crap out of me, i can't use getline() then.




    #include <stdio.h>
    #define MAXLINE 5...
  13. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    re:

    thank you, but could you tell me where my fault lies in my code so at least i could understand why it doesn't work
  14. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    re:

    i like that function fgets() i see it is used a lot to read characters and input, i came across a getline() it was said that it can do the same, i wanted to implement this using the same idea mike...
  15. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    re:

    ohh that program works great,

    ohhh i didn't know about 'fgets'.... can you write this without using fgets?

    how come i want to use int main?
  16. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    humm ok this is starting to make sense now, ...

    humm ok this is starting to make sense now,

    this is the thought i follow when it comes to 'for' loops:

    for (initialisation; condition; iteration) command;


    so if i understand it right I...
  17. Thread: Help a rookie

    by elrookie
    Replies
    14
    Views
    2,008

    Help a rookie

    I'm trying to write a program that will take as an input a string of characters and output their hex representation.

    i decided to start off by writing a program that takes in one input character...
Results 1 to 17 of 17