Message from C, C++ talks

July 2019

— Thank you

— Looks like you literally reallocated 'a' in foo

— If you uncomment 18 line and pass it in foo you don't need malloc at 7 line

— I have probably misunderstood your question...

— 

He does not ubderstand that realloc does not allocate memory from the given address, but it actually changes the address

— Hence a != b after realloc

— Foo gets a copy of a

— Not 'a' itself in that example

— What is x86 or 64 bit

— Size of machine word. Only thing you definitely should know: it affects sizeof pointer and sizeof size_t

Message permanent page

— Architecture

— Hlo

— Hello

— Hii

— #include <stdio.h>
void main()
{
char s[1000];
int count = 0,i = 0;
printf("Enter a sentence\n");
scanf("%[^\n]s", s);
while (i < s[i])
{
if (s[i] != ' ')
{
s[count] = s[i];
count++;
}
i++;
}
printf("Length of semtence excluding space is %d",

I want to print the number of character in sentence excluding space
And using while loop and without using #include<string.h>
What should i do further to print the number of character?

Message permanent page