Search:

Type: Posts; User: DoK

Search: Search took 0.01 seconds.

  1. Thanks.

    Thanks.
  2. What function can I use to copy string from char to char?

    I mean if I have :

    char* str_temp;
    str = "bla cla dla ela";

    how can i copy the string from str 5-8 char to str_temp?

    Thanks!
  3. I usually do something like this: int...

    I usually do something like this:


    int main(){
    char choice;
    while(1){
    fputs("#Please select the exercise (1-5, 0 to exit): ",stdout);
    choice = getchar();

    ...
  4. Replies
    10
    Views
    1,266

    You are the man :cool:

    You are the man :cool:
  5. Replies
    10
    Views
    1,266

    Thanks again! Is it legit if add this function:...

    Thanks again!
    Is it legit if add this function:


    void clear_stdin(){
    int c;
    while((c = getchar()) != '\n' && c != EOF);
    }
  6. Replies
    10
    Views
    1,266

    Actually it is still not working :/ This is...

    Actually it is still not working :/

    This is the new code:


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

    void Ex1(){
  7. Replies
    10
    Views
    1,266

    Thanks:)

    Thanks:)
  8. Replies
    10
    Views
    1,266

    Thank you very much! :)

    Thank you very much! :)
  9. Replies
    10
    Views
    1,266

    This doesn't work as well: void main(){ ...

    This doesn't work as well:


    void main(){
    char letter;
    char* str;
    fputs("Enter char:",stdout);
    fgets(&letter,1,stdin);
    fputs(&letter, stdout);
    }
  10. Replies
    10
    Views
    1,266

    fgets works only with size > 1

    Hi,

    Why this code works:


    void main(){
    char letter;
    char* str;
    printf("Enter char:");
    fgets(&letter,2,stdin);
  11. Replies
    3
    Views
    1,585

    Thanks! I did this: int main(){ char...

    Thanks!
    I did this:


    int main(){
    char taskNumberChar[4];
    int taskNumberInt;

    while(1){
    printf("Please enter task number(1-2, 0 to exit): ");
  12. Replies
    3
    Views
    1,585

    fgets stucks the program

    Hi,

    I need to get a sentence from a user and I have problem with that.

    scanf - not works because I need to get the spaces.

    gets - not secure and for some reason not working, it just skips...
  13. Replies
    11
    Views
    1,612

    I am aware that the code is far from perfect and...

    I am aware that the code is far from perfect and I remember the "tips" that you gave me in my other thread.
    Can you assist me with this one?
  14. Replies
    11
    Views
    1,612

    I don't know what you mean by high/low level...

    I don't know what you mean by high/low level functions. I will google it after I submit this home work. Thanks.
  15. Replies
    11
    Views
    1,612

    Thanks, I know that my code is a mess and...

    Thanks, I know that my code is a mess and somebody told me already about the malloc function, I will implement this next time that I write code.
    For now I have to submit this to my teacher in two...
  16. Replies
    11
    Views
    1,612

    problem in deleting and node from linked list

    Hi,
    I have this code:


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

    // mat1
    #define col_size1 3
    #define row_size1 2
  17. Replies
    6
    Views
    981

    I posted it separately because I have many other...

    I posted it separately because I have many other functions in this file, next time i'll post the full code.
    You right I had to explain what is not working again, anyway sorry for my newbie...
  18. Replies
    6
    Views
    981

    Thank you WoodSTokk...

    Thank you WoodSTokk.
  19. Replies
    6
    Views
    981

    still not working :\

    still not working :\
  20. Replies
    6
    Views
    981

    linked list doesn't stop printing

    Hi,
    I try to add some data to linked list and print it but it doesn't stop printing.. Can you assist please? :)

    This is the code:

    main:

    void third_main(){
    int** arr;
    index_s*...
  21. Replies
    5
    Views
    679

    Thank you very much :)

    Thank you very much :)
  22. Replies
    5
    Views
    679

    Thanks! I know that I am missing includes......

    Thanks!

    I know that I am missing includes... This is just part of the code...
    The "alloc_matrix" is working fine, this is the code of it:


    int** alloc_matrix(int rows, int cols){
    int**...
  23. Replies
    5
    Views
    679

    passing array of struct to function

    Hi,
    I'm trying to make array of struct and I don't get where is my mistake.
    can you help me please?

    This is the code:



    typedef struct{
    int i_index;
Results 1 to 23 of 23