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...
Type: Posts; User: Griffith
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...
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; ...
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....
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...
void remove_filename(char *url)
{
char *p;
p = strrchr(url, '/');
if(p != NULL && *(p-2) != ':')
*p = '\0';
}
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.
...
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)
{
#include <stdio.h>
void readLine (char buffer[]) //function to read what I type in the terminal
{
int i = 0, character;
do
{
character = getchar ();
...
#include <stdio.h>
void calculateTriangularNumber (int n)
{
int i, triangularNumber = 0;
for (i = 1; i <= n; ++i)
...