Search:

Type: Posts; User: ralu.

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    2,658

    Function prototipe: struct tm...

    Function prototipe:

    struct tm *localtime(const time_t *timep);
    struct tm *localtime_r(const time_t *timep, struct tm *result);

    Man page:

    The localtime() function ...
  2. Thread: c puzzle

    by ralu.
    Replies
    25
    Views
    7,604

    I've found this programming puzzle questions on a...

    I've found this programming puzzle questions on a site && i thought to share them with you all:

    Q1 Write a "Hello World" program in 'C' without using a semicolon.
    Q2 Write a C++ program without...
  3. Thread: c puzzle

    by ralu.
    Replies
    25
    Views
    7,604

    If u ran the program as it is you get: ...

    If u ran the program as it is you get:


    01010101

    If the output is redirected to a file, the same result is obtained.


    If you put a \n after "%d" you get:
  4. Thread: c puzzle

    by ralu.
    Replies
    25
    Views
    7,604

    matsp, QuantumPete i was not expecting the pb to...

    matsp, QuantumPete i was not expecting the pb to be interesting for you, cause i know it's not... But on this forum are many newbies for whom this is interesting: the result is not what they expect...
  5. Thread: c puzzle

    by ralu.
    Replies
    25
    Views
    7,604

    Here it is another interesting problem: ...

    Here it is another interesting problem:



    #include <stdio.h>

    int main(int argc, char **argv)
    {
    int i;
    double num = 0.0;
  6. Thread: c puzzle

    by ralu.
    Replies
    25
    Views
    7,604

    c puzzle

    For those who like to keep your mind sharp or for those who want to test their skills in programming here is an interesting C programming bug:


    #include <stdio.h>
    #include <unistd.h>

    int...
  7. Replies
    3
    Views
    1,104

    lol... take a book and learn... have you at least...

    lol... take a book and learn... have you at least read the site page i gave you? i guss not...
  8. Replies
    6
    Views
    1,148

    If by "bitvectors" you mean bit fields than here...

    If by "bitvectors" you mean bit fields than here it is what you can find on wikipedia:

    http://en.wikipedia.org/wiki/Bitfield
    http://www.cs.cf.ac.uk/Dave/C/node13.html
  9. Replies
    3
    Views
    1,104

    read this:...

    read this:
    http://www.geocities.com/learnprogramming123/Clesson11.htm

    You can also search on wikipedia/google for more information or bay a c programming book.
  10. Replies
    3
    Views
    27,292

    The prototipe for strncpy is this: char...

    The prototipe for strncpy is this:


    char *strncpy(char *dest, const char *src, size_t n);

    where n are the bytes of the src to be copied not the sizeof(dest).
  11. Replies
    4
    Views
    1,955

    I've done this with your function and is working...

    I've done this with your function and is working just fine:



    #include <stdio.h>

    void printtofile(char **wrdhold, char *out)

    {
  12. Thread: python c api

    by ralu.
    Replies
    0
    Views
    2,607

    python c api

    I was just playing with python c api for the first time and I've written this (test) module for python:


    #include <Python.h>

    #define VAL1 1
    #define VAL2 2

    struct name_val {
    char* name;
  13. Replies
    2
    Views
    1,291

    First of all the abs function has this prototype:...

    First of all the abs function has this prototype:
    int abs(int j);
    It aspects an int not a float.

    Use one of this instead:

    #include <math.h>

    double fabs(double x);
    ...
  14. Replies
    6
    Views
    17,245

    You can't find it because sleep is a unix system...

    You can't find it because sleep is a unix system call/command. You need its equivalent function in Windows. I'm not sure witch one it is, but i guess it should be smthg like Sleep(). Search for it on...
  15. Replies
    2
    Views
    13,582

    1. you should use int main(int argc, char...

    1. you should use
    int main(int argc, char **argv) or at least int main(). Just main(), it will generate an error, smthg like: main function should return a value - when the program is build with...
  16. Thread: Function Problem

    by ralu.
    Replies
    20
    Views
    2,284

    Your main function should return a value. Pay...

    Your main function should return a value. Pay more attention when typing:


    /* Asks user to input a grade form 0-100 8/


    It should be an * instead of the 8.

    convertGrade function does not...
  17. Replies
    2
    Views
    1,493

    If you know how to use while loop than is simple...

    If you know how to use while loop than is simple to use a for loop instead of the while loop. The similarities between this 2 loop are this:
    *while loop:


    int contor = 0;

    while(cnd) {
    /* do...
  18. Replies
    3
    Views
    1,207

    Yes. Your bug is that u put ";" after while... :...

    Yes. Your bug is that u put ";" after while... :


    while (c != EOF);
    {
    putchar(c);
    c = getchar();
    }
  19. Replies
    13
    Views
    1,888

    It's true that c is case sensitive but for the...

    It's true that c is case sensitive but for the name of the header file it doesn't matter if u write it with lower/upper letters.
  20. Thread: How do I ...

    by ralu.
    Replies
    21
    Views
    3,259

    If u want the user to imput a specific char you...

    If u want the user to imput a specific char you can do smthg like:


    int letter;
    printf ("Please input letter [A or B]:\n");
    do {
    letter = getch();
    letter = toupper(letter);
    }
    while ((letter...
  21. Replies
    13
    Views
    1,888

    The error is because this: Program...

    The error is because this:

    Program Name:program1
    Author:geekrockergal

    This sould be a comment so make it a comment:
    /*
    Program Name:program1
    Author:geekrockergal
    */
  22. Thread: How do I ...

    by ralu.
    Replies
    21
    Views
    3,259

    No. It has nothing to do with the length... 27 is...

    No. It has nothing to do with the length... 27 is the zecimal value of the ESC ASCII char. So that means do that until "ESC" is pressed.
  23. Thread: what are ...

    by ralu.
    Replies
    6
    Views
    1,083

    Preprocessor Directives...

    Preprocessor Directives
    http://en.wikipedia.org/wiki/Preprocessor
    http://en.wikipedia.org/wiki/Directive_(programming)

    User-Defined and Enumerated Data Types...
  24. Thread: How do I ...

    by ralu.
    Replies
    21
    Views
    3,259

    So... if you want to create a program that output...

    So... if you want to create a program that output a letter that the user inputted you can do smthg like this:



    char letter;
    printf ("Please input letter:\n");
    do {
    letter = getch();
    printf...
  25. Replies
    13
    Views
    2,615

    What u wrote is wrong... he has a 9x9 matrix...

    What u wrote is wrong... he has a 9x9 matrix already... to put it your way 0 to 8 is 9. and a[8] in the 9th element.
Results 1 to 25 of 33
Page 1 of 2 1 2