Search:

Type: Posts; User: giorgosmarga

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    3,642

    A string from a different function

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

    void changeString(char *str);
    int main(){
    char *string;
    string = (char *)malloc(5 * sizeof(char));
    ...
  2. Replies
    5
    Views
    5,928

    I am supposed to use read and write system calls

    I am supposed to use read and write system calls
  3. Replies
    5
    Views
    5,928

    system calls read and write

    Hey,
    Is it even possible to write to a binary file a number as an int and not as a string? If yes how do i write it and how to i read it?
  4. Replies
    14
    Views
    10,647

    >There is a need to cast malloc in C since the...

    >There is a need to cast malloc in C since the exercise says so.

    >How should i make tableRgs be the pointer I get from malloc.
  5. Replies
    14
    Views
    10,647

    typedef struct { long unsigned int code;...

    typedef struct
    {
    long unsigned int code;
    fullName name;
    short unsigned int matches;
    } registers;


    typedef struct{
    registers **rgs;
  6. Replies
    14
    Views
    10,647

    After realloc i am checking if the pointer if...

    After realloc i am checking if the pointer if null, if it is it returns. Thats why i am kinda confused, my program crashes instead of returning.
  7. Replies
    14
    Views
    10,647

    Realloc limit

    Hey,
    My programs crashes after the 27th time i call realloc. Is there a limit in realloc or what else could it be?
  8. Replies
    3
    Views
    5,979

    And if i do this: registers rg; matches...

    And if i do this:


    registers rg;
    matches mtchs;
    rg.codeName = 123;
    rg.matchCode = 123;
    strcpy(rg.name->fullName, "123");
    strcpy(rg.name->lastName = "123");
  9. Replies
    3
    Views
    5,979

    Array of pointers to structs

    I am kinda confused with this.




    typedef struct{
    char firstName[SIZE];
    char lastName[SIZE];
    } fullName;
  10. Stop a while/for loop when the user inputs a string

    Hello,
    How can i break a for/while loop when the user enters a specific string?

    In the main function, I ask the user to enter 10 strings and the programm should stop when the user enters for...
  11. Make an array the same as an array from a function

    Hey,
    I have a function that returns an array that contains all the digits of a number


    int seperation(int number){
    int arrayOfDigits[SIZE];
    int i = SIZE - 1;
    int lastDigit;
    ...
  12. Replies
    4
    Views
    7,412

    fgets and size

    Lets say i want to create a programm that takes a string and prints it
    At the beggining i have to declare my string and give it a size.For example, if i give it 10, can i write this?...
  13. Thread: struct

    by giorgosmarga
    Replies
    1
    Views
    8,798

    struct

    Hello guys,
    I want to create a struct that lets say is the employee and contains some values for the employee
    If i want to create n employees(The user says how many are the employees of the...
  14. Replies
    1
    Views
    9,336

    The last character of a string

    int main()
    {
    int lastDigit;
    char num1[3] = "123";
    lastDigit = strlen(num1) - 1;
    printf("%c", num1[lastDigit]);
    return 0;
    }

    Guys, any idea why this code doesnt work?
Results 1 to 14 of 14