Click here to Skip to main content
15,033,650 members

Comments by Member 14161770 (Top 22 by date)

Member 14161770 15-May-19 3:12am View
1) The input values it is actually using. Not the values in the "a, b, and c" files, or the values in the DB, but the actual values the app is using to create the file "d".- I tried finding out this, but failed as the file conatians values as i mentioned above
2) How it combines those values to produce a file. - the command used is :sprintf (buff, "cat %s >> %s",
file_a, file_d);
3) The output values it actually generates.
4) The output values you expect "d" to contain.
3 & 4 - some are correct and fileds are coming -ve randomly
Member 14161770 6-May-19 3:20am View
Our host runs on IBM mainframe, which need data in the same format :P
Member 14161770 17-Apr-19 0:13am View
I completely understand your concern. I found out the line causing seg.fault and it shows Cannot access memory at address 0x0 which means it refers to NULL value. digging why it happens because I know that we have the data to print
Member 14161770 16-Apr-19 8:25am View
Ok. Let me explain it in detail
Suppose there are 3 customers details which the query fetches to print on screen
the data is presrent in a linked list
A while loop checks for the!=NULL
and then prints the data.
the ll should move to the next record once it prints the details of current record and it moves.
I am able to print the next record also where it does link=link->next
but when it comes to a point to check whether the data is not null it throws seg fault
I repeat, for the 1st cust. it prints details successfully. for the next record, it throws seg.fault
Member 14161770 16-Apr-19 1:05am View
When i am running it in debug mode, its getting values, but throwing seg.fault once it completes the while loop to fetch values
Member 14161770 16-Apr-19 1:05am View
When i am running it in debug mode, its getting values, but throwing seg.fault once it completes the while loop to fetch values
Member 14161770 15-Apr-19 9:33am View
when ran in debug mode, it fetches value and prints
but in normal mode, it prints nothing
Member 14161770 15-Apr-19 1:10am View
and once it goes through the while loop to fetch and print vales, throws a segmentation fault and quits.
Member 14161770 15-Apr-19 1:05am View
if the data issue refers to the above mentioned corruption, why the same I am able to get as o/p from db server separately?
Member 14161770 15-Apr-19 1:01am View
I debugged the code and printed values the query fetches. In gdb mode it gives o/p. But while running in normal mode, nothing it prints
Member 14161770 14-Apr-19 9:38am View
I debugged the code. Each point i tried printing the values the code fetches. It prints those values correctly (in debugging mode). But when running in normal mode, it prints blank(no values)
Member 14161770 28-Mar-19 23:04pm View
This solution seems to work, also, I will try with a string logic
Member 14161770 28-Mar-19 13:16pm View
Please check :

long long int i=0,cp=0;
int count=0,d=0;
int l=20;
printf("\neneter num\n");
while(i != 0)
i /= 10;
printf("%d is total count\n",count);
Member 14161770 28-Mar-19 13:04pm View
It is working now. My compiler is cc, env-AIX code is :
long long i=0;
printf("\nenter num\n");

So, the catch here is there is chance my value to be of length 20 digits also.
In that case, if i pass a 20 digit value (less than 2^64 -1) it is printing garbage. Rest all case (for all length digits) its working. What is the problem for 20 digit num?
Member 14161770 28-Mar-19 12:10pm View
If I try the same in my env. its not working. I tried using online compiler, its working
Member 14161770 28-Mar-19 8:42am View
Nothing seems to be working and interesting part is its part is its printing some random value. But on a normal compiler this is working

i/p: 102012000000000001
o/p : 0010201200000000000120
Member 14161770 28-Mar-19 5:03am View
The same thing if u run in online compiler is working.
So, any settings is missing?Mine is AIX platform
Member 14161770 28-Mar-19 3:00am View
What I tried is long long i=0;
printf("\nenter num\n");

but in o/p i am getting 2 digits extra:


What is the error?
Member 14161770 27-Mar-19 14:15pm View
Is casting there in C?
Member 14161770 27-Mar-19 13:59pm View
getting warning as "(W) Integer constant 123456789876543219L out of range"
Member 14161770 25-Feb-19 21:53pm View
Sorry, but I cannot do that. My question is simple. What are the possibilities for this empty value to come?
Member 14161770 25-Feb-19 5:17am View
It is sybase,