Search:

Type: Posts; User: rusyoldguy

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    268

    Hallo shaswat! This way was one of the elder...

    Hallo shaswat!

    This way was one of the elder standards of c


    // Forward declaration of a function
    #include <stdio.h>

    void tom(void)
    {
  2. Example to encrypt and decrypt files with permutated numbers

    Here is a program were i wrote by my own with Qt for linux to encrypt and decrypt files.
    It based on transposition of bits. It splits a file into blocks of a length you can
    select between 64, 128,...
  3. Simple way to store a 64 bit unsigned long into four unsigned short with union

    Hi guys!

    Here is a simple program what shows how to store a 8 byte long unsigned long into 4 unsigned short:
    first the header lintunion.h:


    #ifndef LONGINTUNION_H_INCLUDED
    #define...
  4. Replies
    15
    Views
    507

    Hi Foxel! The normal characters of a string...

    Hi Foxel!

    The normal characters of a string are between 32(space) and 127.
    It is possible that some systems have an other length for different characters. See UTF8 by Wikipedia



    //converts...
  5. Example to show possible combinations of numbers

    Hallo san12345!

    May be there is an example for you. IO wrote it by my own.
    But the program is in german language.
    But i hope some parts of the program can help cou.
    There are three parts:

    1....
  6. Replies
    5
    Views
    245

    Hallo Ivory348 Look at line 5: for(x =...

    Hallo Ivory348

    Look at line 5:


    for(x = 0;x<cntr+1;cntr++) puts(keys[x]);
    [code]
    The integer 'x' has always the same content.
    It can't get bigger.
    The validity of 'x' is only for the...
  7. Replies
    2
    Views
    214

    I hope this example could help you: /*...

    I hope this example could help you:


    /* Example for scanf to limit the number of characters where read into a string
    In this example scanf reads only characters are stored between the square...
  8. Replies
    6
    Views
    338

    Hallo Lolcoman! May be you can use strtok()...

    Hallo Lolcoman!

    May be you can use strtok() declared in string.h (also cstring)
    you can see a example:


    // splits a String into several parts
    #include <stdio.h> //printf
    #include...
  9. Replies
    2
    Views
    281

    Hello varja11! If you want to print the...

    Hello varja11!

    If you want to print the address of a variable it is better tu use '%p' instead of 'd'
    All three variables of int have the same size, so they starts at the same place in memory....
  10. Replies
    4
    Views
    384

    May be here is an example what can help you: ...

    May be here is an example what can help you:


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


    void deztobin(unsigned int decimalvalue, char zudi[], int prezeros);
    void...
  11. Replies
    3
    Views
    257

    By the way i think it could be a reason to...

    By the way i think it could be a reason to declare the length of the array str[] by 'N':
    the string what you read in in line 17 of your example is not limited.
    That could be a reason.
    Now my...
  12. Replies
    3
    Views
    257

    Hello Chibisco! the next input with _getch()...

    Hello Chibisco!

    the next input with _getch() takes the character from the keyboard-buffer of the last input.
    Co can delete this buffer with a simple function:



    void...
  13. Replies
    3
    Views
    193

    Hallo abhi143! I hope the example below will...

    Hallo abhi143!

    I hope the example below will give you some inspirations:


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

    struct node {
    int x;
  14. That's clear, because yo call the function 'sum'...

    That's clear,
    because yo call the function 'sum' first in line 47 as the first argument of function 'sumResult'
    and then in line 48 again. The variable 'n' is only valid in 'sum', after calling...
  15. Replies
    7
    Views
    381

    A example who is better to understand is: ...

    A example who is better to understand is:


    #include <stdio.h>
    #include <stdlib.h> /* strncpy, EXIT_SUCCESS */
    #include <string.h> /* strlen */


    // copies a part of a string of zfolge from...
  16. Replies
    7
    Views
    381

    I'm trying to write a function ('rotate') that...

    I'm trying to write a function ('rotate') that rotates the first n elements of my string array arr by shift positions in the clockwise direction if shift is positiv (anti-clockwise if negativ shift)....
  17. 1-I don't know how to make C understand that I...

    1-I don't know how to make C understand that I want it to take into account a button I pressed without requiring ENTER.

    For Linux i found this little Program:


    /* -*- Mode: C;...
  18. Replies
    8
    Views
    307

    Sorry guys, for the comments in german!

    Sorry guys, for the comments in german!
  19. Replies
    8
    Views
    307

    gets() has been removed from the C11 Standard ...

    gets() has been removed from the C11 Standard

    You can take


    scanf("%19[^\n]", ten[i]);


    This code is an example to tell 'scanf' for read all letter(including space) but not the...
  20. Replies
    2
    Views
    219

    Hi, you're right. I think it would be good to...

    Hi,

    you're right. I think it would be good to clear with a little function
    the keyboard-buffer to prevent that the next call of 'scanf'
    takes the signs who are in the keyboard-buffer after the...
  21. Replies
    11
    Views
    493

    I think he want's to calculate the day of the...

    I think he want's to calculate the day of the week given by a date, or the Date of Easter Sunday given by a year. May be according the formula of Zeller's congruence, Butcher or Gauss. But it looks...
  22. Hi nerx! The second way to do it is: ...

    Hi nerx!

    The second way to do it is:


    #include <stdio.h>

    int fact(int num); // don't forget the right declaration

    int main(int argc, char **argv)
  23. Replies
    14
    Views
    749

    Hi Yoav! I have only a simple Program with...

    Hi Yoav!

    I have only a simple Program with comments in german, but may be it can help you:

    first the file permutieren.h



    #ifndef PERMUTATION_H_INCLUDED
    #define PERMUTATION_H_INCLUDED
  24. Replies
    13
    Views
    1,200

    With two little changes of the last examples: ...

    With two little changes
    of the last examples:


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

    int kbhit(void)
  25. Replies
    13
    Views
    1,200

    usein kbhit() in c instead of inkey in qbasic

    Hallo zach!
    May be if you work with Linux, you can use kbhit() from this example:


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

    int kbhit(void)
Results 1 to 25 of 37
Page 1 of 2 1 2