Search Results

Showing results 1 to 26 of 26
Search took 0.01 seconds.
Search: Posts Made By: ambarisha.kn ; Forum: C and child forums
Forum: C Aug 10th, 2009
Replies: 4
Views: 689
Posted By ambarisha.kn
/*decimal to binary*/
#include <stdio.h>

void printBinary(const unsigned char val) {

for(int i = 7; i >= 0; i--)

if(val & (1 << i))

printf("1");
Forum: C Nov 5th, 2008
Replies: 1
Views: 620
Posted By ambarisha.kn
Its so simple, we have to write "wb" in fwrite instead of "w" , while writing binary file.

FILE *f1;
f1=fopen("c:\\ambi.dat", "wb");
fwrite(constDataArea, 1,4, f1);
fclose(f1);



I did...
Forum: C Nov 5th, 2008
Replies: 1
Views: 620
Posted By ambarisha.kn
Consider d_type=POINT_LONG in the following program.
and data.Long=0xA;

In the following program i am getting correct output in constDataArea[0],constDataArea[1],constDataArea[2],...
Forum: C Oct 23rd, 2008
Replies: 6
Views: 921
Posted By ambarisha.kn
Thanks Salem, I got it..

Actually i was confused with offset and address. Now i got it what is offset.

My code is working fine..
Code is as follows.
please suggest me if there is any better...
Forum: C Oct 22nd, 2008
Replies: 6
Views: 921
Posted By ambarisha.kn
How to get the current address. Actually first i leave some empty space to write the offset address.
After writing data from buffer, i have to calculate the offset address and have to write back the...
Forum: C Oct 22nd, 2008
Replies: 6
Views: 921
Posted By ambarisha.kn
Forum: C Oct 22nd, 2008
Replies: 6
Views: 921
Posted By ambarisha.kn
I wrote the following function and it is working fine, but my problem is i want to write forward pointer address in present pointer field.

I will explain in code.
please check line numbers 10,...
Forum: C Oct 21st, 2008
Replies: 3
Views: 820
Posted By ambarisha.kn
i tried that one, but it was giving error aschange of char ** to char* is not possible
Forum: C Oct 21st, 2008
Replies: 3
Views: 820
Posted By ambarisha.kn
I wrote the following function. i want to return fbCodeAddr and tmpAddr to the main function.

How to do this?

Function is as follows;


void fbExeCode(int BldCnt)
{
// for(int...
Forum: C Sep 27th, 2008
Replies: 4
Views: 560
Posted By ambarisha.kn
Thanks i got my mistake.
Forum: C Sep 27th, 2008
Replies: 4
Views: 560
Posted By ambarisha.kn
But if i make DB, DC as char its not possible to add 1024.

then how to add 1024 bytes to that
Forum: C Sep 27th, 2008
Replies: 4
Views: 560
Posted By ambarisha.kn
Hi,

I am allocating memory for some areas. For DB i need 1024 bytes, for DS 1024*2 bytes and so on, and i initialised address as follows.

I initailise devBaseAddr to DB, because DB comes...
Forum: C Sep 2nd, 2008
Replies: 2
Views: 976
Posted By ambarisha.kn
Before i was opened the file as follows.

out_fp = fopen(oppath,"wb");


i am not writing into dat file. I am writing to text file. so i changed the code as follows and its working fine.....
Forum: C Sep 2nd, 2008
Replies: 2
Views: 976
Posted By ambarisha.kn
Hi everybody,

I want to write enter in a text file. How to do this. I wrote the code as follows. see if i write like this, it is printing one special character like arrow. I want to print in the...
Forum: C Sep 2nd, 2008
Replies: 2
Views: 419
Posted By ambarisha.kn
Thnaks. Its working fine
Forum: C Sep 1st, 2008
Replies: 2
Views: 419
Posted By ambarisha.kn
I have input files like this
a.iup
b.iup
c.iup.......

i have these input files in a variable called fname;
like this

char *fname="c:\\iupfiles\\a.iup";
every time i will get file name in...
Forum: C Sep 1st, 2008
Replies: 2
Views: 1,679
Posted By ambarisha.kn
Thanks its working fine
Forum: C Aug 31st, 2008
Replies: 2
Views: 1,679
Posted By ambarisha.kn
I want to read all files in a particular folder using C programming. HOw to do this. Thanks.

Ex: I have some 5 files in folder named c:\temp.
I want to read all files one after another and want...
Forum: C Aug 21st, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
i will not get next datasize, because i used unions. only one data will get at one time..
Forum: C Aug 20th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
i have changed some corrections in the above code. is the following programming is good or please suggest me some other good idea.


char *constDataArea;
data.Short=5;
data.Long= 6;...
Forum: C Aug 20th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
In the following code, we will get the output, and the data stores as follows.
actually i am getting dynamic input data..
first char is stored at 0th position
second long is stored at 1st...
Forum: C Aug 20th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
This code is correct. we will get expected o/p. but the printf of last statement is wrong.
so we have to replace that printf as follows.

printf("const area:%d\t%d\t%d\t",constDataArea[0],...
Forum: C Aug 20th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
Expected o/p is 1 5 6. but i am getting 1 0 0.. what is the corrections to get the expected o/p???

char *constDataArea;
data.Bool=1;
data.Short=5;
data.Long= 6;


const size_t BUFSIZE =...
Forum: C Aug 19th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
i implemented the above said logic in my program. its giving 3 errors. i have mentioned errors below the code


const size_t BUFSIZE = 1048576;
size_t datasize, nextpos, freepos=0;
char...
Forum: C Aug 19th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
Thanks for reply. i will check this..
thank u very much
Forum: C Aug 19th, 2008
Replies: 17
Views: 1,244
Posted By ambarisha.kn
hi,

i have some data in variables of different types.(short, int, long, float, char, double). now i have to create one pointer, have to allocate 1mb memory and have to store one by one in that...
Showing results 1 to 26 of 26

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC