This is a c program to collect lines in a buffer ..
I am getting segmentation error whenever i try to print the har array for the program
I am reading a book of c and this was the function in that ,but i am trying to write it with main. ie without using fuction Code:
#include<stdio.h> |
First, and foremost! Indent your code properly. Without proper indentation not only you won't see what your program is doing, but also no one here will bother to read the code.
Second of all, when you compile your code, enable all warnings and even turn them into errors, like so: Code:
gcc -o example -Wall -Werror -Wextra example.c
I hope those hints will help you solve your problem. Since you are learning it's better if you figure this one out for yourself. And remember, compiler is your friend – listen to what its saying. |
Not getting the purpose of your code..
the Error free code is here Code:
#include<stdio.h> |
try this:
Code:
/* batman4.c */ |
All times are GMT -5. The time now is 06:46 AM. |