Search:

Type: Posts; User: maverix

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    2,797

    That was a good one ;)

    That was a good one ;)
  2. Replies
    11
    Views
    2,797

    Agreed ;) but i thought having large variable...

    Agreed ;)
    but i thought having large variable names for loop index would make the lines too long.
  3. Replies
    11
    Views
    2,797

    Well....here's my version, but I am not using...

    Well....here's my version, but I am not using strtok and storing the words in a string array, instead the original string is indeed reversed with the last word appearing first, last but one second...
  4. Replies
    35
    Views
    9,220

    This can be done in a better way!!! void...

    This can be done in a better way!!!


    void count(const char myStr[]){
    declare an array of 26 integers to store the count of each alphabet

    initialize the array variables to zero

    ...
  5. Replies
    21
    Views
    22,235

    how about declaring it static int number =...

    how about declaring it


    static int number = 0;


    I guess (not sure) it would not initialize it each time it enters the loop. Somebody please confirm :-)

    maverix
  6. Thread: Game of Life

    by maverix
    Replies
    74
    Views
    21,234

    Hi, Once the contest ends, will you be posting...

    Hi,

    Once the contest ends, will you be posting the best code so that others could learn?

    cheers
    maverix
  7. better still, you could declare a structure as...

    better still, you could declare a structure as per the requirements and write it to files



    #define STR_SIZE 20

    typedef struct {
    char string[STR_SIZE];
    int a;
    int b;
  8. Replies
    132
    Views
    721,326

    Sticky: Hi everybody, I had written this game long...

    Hi everybody,

    I had written this game long back but it was very primitive.
    I've refined it a bit using curses library.
    Check it out and let me know your feedback and suggestions. ;)

    btw, the...
  9. Replies
    5
    Views
    1,135

    this would do... for(i=1;i

    this would do...


    for(i=1;i<=100;i++)
    printf("door %d - %d\n", i, door[i]);


    maverix
  10. Replies
    5
    Views
    1,135

    you are comparing two literals in the statement...

    you are comparing two literals in the statement which is true forever...


    for(i=1;1<=100;i++)


    you need to change it to


    for(i=1;i<=100;i++)
  11. Replies
    3
    Views
    975

    well, i thought palindrome is something which...

    well, i thought palindrome is something which reads the same backwards, something like


    "madam",
    "civic",
    "level",
    "was it a rat i saw"


    search through this forum with the keyword...
  12. Replies
    97
    Views
    9,567

    you've been answered on this a number of times. ...

    you've been answered on this a number of times.


    hundreds = number/100; // for 1782, you'll get 17


    cheers
    maverix
  13. Replies
    97
    Views
    9,567

    hi lol...lol, ah yes, a prettly long thread!!!...

    hi lol...lol,
    ah yes, a prettly long thread!!! however, this thread was not started by me
    if you really care to know the problem statement, you could go to the first post of this thread ;-)
    ...
  14. Replies
    97
    Views
    9,567

    break the year 1782 into hundreds, tens and ones...

    break the year 1782 into hundreds, tens and ones (as shown in my previous post)


    break the year 1782 into hundreds, tens and ones (as shown in my previous post)
    if(hundreds == 17)...
  15. Replies
    97
    Views
    9,567

    I am not sure whether you are supposed to use...

    I am not sure whether you are supposed to use character arrays for your assignment, but nevertheless, all you need is



    const char *unitStr[10] = { // string constants for unit places
    ...
  16. Replies
    97
    Views
    9,567

    Now that he's got the answer, I'd like to post my...

    Now that he's got the answer, I'd like to post my version


    void processInput(int year, int month)
    {
    int leap = ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )? 1:0;
    //...
  17. Replies
    50
    Views
    5,220

    nice thread :-) am going to start using a...

    nice thread :-)
    am going to start using a debugger now...

    cheers
    maverix
  18. Thread: Idiot guide

    by maverix
    Replies
    20
    Views
    2,555

    below is the equivalent while loop, this could...

    below is the equivalent while loop, this could give you an idea :-)



    int i = 9;

    i--; // initialization
    while(i--){ // check the condition
    ...
  19. Replies
    9
    Views
    2,741

    one way to find out is to reverse the number and...

    one way to find out is to reverse the number and check if the resulting number is equal to the original number.



    initialize r_num to 0
    while num is positive
    multiply r_num by 10 and...
  20. Thread: Rand and srand

    by maverix
    Replies
    5
    Views
    11,199

    check out this site for info on random...

    check out this site for info on random numbers...its from one of the C board members

    http://www.eternallyconfuzzled.com/tuts/algorithms/jsw_tut_rand.aspx

    cheers
    maverix
  21. you can use strcat to concatenate two strings...

    you can use strcat to concatenate two strings
    for eg:
    strcat(str1,".gb");
    assuming str1 is a string with contents "AJ002507".

    cheers
    maverix
  22. Replies
    8
    Views
    1,411

    Go through K&R a number of times....you'll learn...

    Go through K&R a number of times....you'll learn something new each time (at least, I did) :)

    cheers
    maverix
  23. Replies
    4
    Views
    2,721

    No, the type of tmp is the one which precedes it,...

    No, the type of tmp is the one which precedes it, 'test' in this case.

    the typedef statement defines an alias for an already existing datatype or to create a new user defined datatype.


    eg:...
  24. Thread: Upset?

    by maverix
    Replies
    22
    Views
    3,177

    that was a great post by iMalc :) One needs to...

    that was a great post by iMalc :)
    One needs to enjoy whatever he is involved in!!!

    Don't give up, though!!!
  25. Replies
    39
    Views
    5,075

    Another way of arriving at the start and end...

    Another way of arriving at the start and end limit is to start from factor 1 up, store the quotient in another variable, increment factor until it reaches the quotient. Make sure that you update the...
Results 1 to 25 of 46
Page 1 of 2 1 2