Menu
'Segmentation fault' means that you tried to access memory that you do not have access to.The first problem is with your arguments of main. The main function should be int main(int argc, char.argv), and you should check that argc is at least 2 before accessing argv1.Also, since you're passing in a float to printf (which, by the way, gets converted to a double when passing to printf), you should use the%f format specifier. The%s format specifier is for strings ( '0'-terminated character arrays).
Make sure you installed NS correctly. East download one TCl file which does not run nam.
If you do not know nam is just for depicting the algorithm graphically. After download and run TCL file ( As I said download nam free or at least your self disable that line or make them as comment on your TCL file.There is some problems on running nam on 14.04. You should download nam from and copy the extracted file in to your /usr/local/bin. But I just test that for ubuntu 32 bit 14.04.By the way if you are new to NS2. I should tell you it not necessary to follow erlang NS2 method. If you are enough not in horry I recommend you to look at here.
![How How](/uploads/1/2/5/6/125659343/304033924.png)
Re: Runtime Segmentation fault - core dumped. You probably did not change the declaration of emprec as suggesed in point 1. To me, when fetching multiple rows, declaring the array of struct is more meaningful rather than having a struct with individual elements as arrays (unless you were fetching into the individual elements in your fetch call).