Finding the length of a Character Array in C?

What is a way in C that someone could find the length of a Character array? I will happily accept psuedo-code, but...

Is there a function to copy an array in C/C++??

I am a Java programmer learning C/C++. So I know that Java has a function like System.arraycopy(); to copy an array....

what is stack smashing (C)??

Code: int str_join(char *a, const char *b) { int sz =0; while(*a++) sz++; char *st = a -1, c; *st ...

How do I lowercase a string in C??

How can I convert a mixed case string to a lowercase string in C? ...

How to use struct timeval to get the execution time??

After reading this article about elapsed time, I wrote a simple code to calculate the execution time of a loop: #in...

Having a function change the value a pointer represents in C?

I have a main function that has a char, I am attempting to pass a pointer to that char into a function and have it c...

What is the cause of flexible array member not at end of struct error??

I am wondering why I keep getting error: flexible array member not at end of struct error when I call malloc. I have...

What is a good project structure in C?

I have been working in Java/J2ee projects, in which I follow the Maven structure. I want to develop [say a command l...

Why am I getting this memory access error 'double free or corruption'??

I am getting the following type of error. I know it has something to do with me improperly accessing memory, but I d...

Print the structure fields and values in C?

I am interested in printing the structure fields . Typedef struct { UINT32 thread_id; BOOL is_valid; }T_THR...

How to copy a char array in C??

In C, I have two char arrays: char array1[18] = "abcdefg"; char array2[18]; How to copy the value of array1 to ar...

What is a bus error??

What does the "bus error" message mean, and how does it differ from a segfault? ...

Delete a file named “NUL” on Windows?

I ran a program on Windows 7 that was compiled under Cygwin and passed "NUL" as an output file name. Instead of supp...

Do we lose data in a buffer after realloc'ing??

I'm having troubles understanding how realloc works. If I malloc'ed a buffer and copied data to that buffer, let's s...

How to send EOF via Windows terminal?

I'm trying to comprehend Example 1.9 from the K&R book, but I don't get how to send EOF. Some sources mentioned ...