Search:

Type: Posts; User: Griffith

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,944

    Array of pointers, pointers to pointers.

    This program ask to the user to enter words, then it shows the words sorted. My question is If I've used correctly malloc and realloc correctly since I'm still proccessing the concept of pointer to...
  2. Replies
    11
    Views
    945

    p_x is the declared variable, of type int *. A...

    p_x is the declared variable, of type int *. A pointer to an int. You can see it like this (int *)p_x. In the declaration int *p_x = &x its the same if you do it in diferent statements: int *p_x; ...
  3. Replies
    7
    Views
    1,241

    But when im initializing the array, it lets me do...

    But when im initializing the array, it lets me do it far ahead of the 10 ints that I wanted. I was expecting some kind of warning from the compiler, or weird numbers after the 10th element, but no....
  4. Replies
    7
    Views
    1,241

    malloc function

    Im learning the dynamic storage allocation functions and I have a question about why this is happening. I made a function my_malloc that takes my request in bytes as argument and should return a...
  5. Thread: string strcpy

    by Griffith
    Replies
    8
    Views
    1,513

    void remove_filename(char *url) { char *p;...

    void remove_filename(char *url)
    {
    char *p;

    p = strrchr(url, '/');

    if(p != NULL && *(p-2) != ':')
    *p = '\0';
    }
  6. Thread: string strcpy

    by Griffith
    Replies
    8
    Views
    1,513

    string strcpy

    So one of the exercises im doing says "do a function that removes a file name"
    For example:
    Input: "http://www.example.com/index.h
    Output: "http://www.example.com"
    This is the function I made.
    ...
  7. Replies
    1
    Views
    817

    Two dimensional arrays and pointers

    I'm not understanding what's happening here.
    15726

    It seems that I'm feeding the function in the wrong way


    #define LEN 4

    int sum_two_dimensional_array(const int a[][LEN], int n)
    {
  8. Replies
    1
    Views
    519

    strings & arrays question

    #include <stdio.h>

    void readLine (char buffer[]) //function to read what I type in the terminal
    {
    int i = 0, character;

    do
    {
    character = getchar ();
    ...
  9. Replies
    1
    Views
    315

    Trying to understand why this happens

    #include <stdio.h>

    void calculateTriangularNumber (int n)
    {
    int i, triangularNumber = 0;

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

    ...
Results 1 to 9 of 9