*** stack smashing detected *** - this is the error I got when I ran my program. After doing some google, i found this happens for the buffer overrun. I looked into the program line by line to find...
Type: Posts; User: chakra
*** stack smashing detected *** - this is the error I got when I ran my program. After doing some google, i found this happens for the buffer overrun. I looked into the program line by line to find...
As per your code
inPut = getNumber();
getNumber() is supposed to return something. Here you are assigning it to inPut, So make sure it has the same return type for the getNumber.
Your...
......
first thing... inPut is declared as num. I hope you have changed it to int.
second getNumber declaration void getNumber(void); it is not matching with the way you are using..
your declaration...
What I meant was if suppose four bytes has the value say x'00558844'. So I will take the first byte(from the left), x'00'. Since it is zero I will add 8 to the result and now go with second byte...
Thanks for the explanation on the lookup table.
for the 32 channels, as said I can go byte by byte starting from msb . I will proceed to the next byte, only if the current byte is 0.For every...
yeah something like that. if the value > 128, then 1
128>value>64,return 2.
But I cannot go with this. As 8 channel is just an initial value. It might get up to 32 channels. In that case writing...
Hi,
First of all very sorry for coming up with such a vague title. I couldn't think any better title for this thread.
I have been asked to use a byte for representing 8 different channels. Every...
Thanks!
Yes, You are right. I missed the function declaration in the header file.
Thanks to all for their kind help.
I am using gcc. Your code doesn't give me any error or warning.. Job is char *. Let me see what is wrong with mine.
Hi All,
Greeting!
I am getting this error " assignment makes pointer from integer without a cast" for this line.
root=addtree(root,job);
Declaration for addtree is as follows
If you want to do the sorting and grouping through the program,i would suggest take a look on tree structure or Map. Both of them are mentioned already in the previous posts. I am not sure about how...
Thanks!.
I changed the code as said and in future I will keep this in my mind.. :)
I too felt the same when i posted it for the first time.I was thinking whether is there really a need to post the entire code.But when I removed the other codes keeping only the problematic part, i...
Yes, I was looking for binary mode and fwrite did it well. :)
thank you.
How to write an int variable to a file in c?
Reading files :you can use FILE functions. FOPEN and fgetc.
space delimiter : you can use the isspace function
Grouping and sorting can be done with a tree structure.
I have modified the code as said by mutandis. I have changed the malloc functions as needed. Changed the count_elements to be reusable.
And regarding the design, the init() function has to be...
Reason for using static on most of function is because i do not want these functions to be visible outside this file. Whatever i have done so far, i do not think is not even 50% of total concept ....
Thanks. I will correct the malloc statements. Regarding the type casting i followed what i read from K & R. After going through the FAQ, I got the useful information. thanks.I will do the necessary...
Hi,
Let me first introduce my self. I am chakravarthi. I am not new to this forum, but i am not very active participant. Today I come here seeking for help on the below code.I have no clue about the...
well in that case try this
double sine(float x)
{
int i,n;
int sign = -1;
double sum = x,power=x,fact = 1.0,psum=0.0;
for (i = 1; fabs(fabs(sum) - fabs(psum)) > 0.0000000001; ++i)
...
double sine(double x)
{
int i,n;
int sign = -1;
double sum = x,power=x,fact = 1.0;
for (i = 1; i < infinity; ++i)
{
power = power * x *x;
n = (2*i+1);
scanf("%s", &fileOutName); - not correct.
fileoutname is an array,so your statement should be
scanf("%s", fileOutName);