yuvaraj.tr -3 Newbie Poster

Hi ,

I have one buffer size is 50 bytes and reading 50 byte data from file

unsigned char bufffer[50];

read(fd,buffer,50); // Consider each byte numerical is value is zero.

printf("@@%s@@",buffer); // Here i will get @@@@ only.

But I want @@(50 zero)@@ as output(i have to use %c or %s only). If 25th byte numerical value is zero. It will print only 25 bytes only but i want print entire buffer if it has null terminal(ZERO) middle of the buffer also)

Any help !!

yuvaraj.tr -3 Newbie Poster

Hi i am new


I have two c prgorams as yuva.c & raj.c

For this how i create make file

please help me


Thanks

Yuvaraj R

yuvaraj.tr -3 Newbie Poster

Thanks for your people helping


Thanks

Yuvaraj.R

yuvaraj.tr -3 Newbie Poster

Hi I have doubt . Can we return the some data from boolean Function in C

For Example

bool add( int a, int b)
{
   int C;

  C = a + b;

return C;
}

Is it possible in C

yuvaraj.tr -3 Newbie Poster

FGS_GetCurrentKeyCode() means some driver library function in set top box.

if i press the keys ,while running the game that time snake did not move according to the key directions..


Once game is over . Then it takes the key value and move according to the pressed key direction when i am running snake game again.


Please help me


Thanks

Yuvaraj.R

yuvaraj.tr -3 Newbie Poster

Hi friends i am doing the snake game program for Set top Box . I am Facing problem when i get the remote control keys.


if i press the up,down,right,left keys when program is running ,program does not response .once game is over then it is taking the values from keys.

Please help to solve this problem

Note : i am getting the keys through the MENU_GameKeys function,

and game starts at runsnake function

I post some parts of code here.........


Advance thanks for helping

yuvaraj.tr -3 Newbie Poster

wait i send you

yuvaraj.tr -3 Newbie Poster

for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
printf("*\n");
}
}

yuvaraj.tr -3 Newbie Poster

for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
{
printf("*\n");
}
}

WaltP commented: Before postin code, try running it first to see if it works. This code is extremely wrong. -3
yuvaraj.tr -3 Newbie Poster

hi gues am new to embedded c,i wrote programm to addition of two numbers

but i didn't get the result....

I don't what is the wrong in my code

my code is:

include <reg51.h>
#include <stdio.h> extern unsigned int getnumber (void);
extern void output (unsigned int);

void main (void)
{
unsigned int number1, number2;
bit operation;

SCON = 0x50;
TMOD = 0x20;
TR1 = 1;
T1 = 1;
TH1 = 221;
printf ("hi yuvaraj");

while (1) {
number1 = getnumber ();
number2 = getnumber ();
printf ("Input operation: '+' (ADD) or '-' (SUB) ? ");
operation = (getchar () == '+');
output (operation ? (number1 + number2) /* perform operation */ : (number1 - number2) );
}
}


please help me

yuvaraj.tr -3 Newbie Poster

int i=444;
printf("9%d",i);

devnar commented: Eh? +0
yuvaraj.tr -3 Newbie Poster

Hi i am also new to C

I think ans may be

X=2, Y=8,z=61

yuvaraj.tr -3 Newbie Poster

Above answer is exactly correct ............


please follow that one...........

yuvaraj.tr -3 Newbie Poster

vi editor
emacs editor
one more is there

yuvaraj.tr -3 Newbie Poster

movi a ,#2 ; immediately move 2 to accumulator
mov b,a ; move accumulator to b Reg
mvi a, #4 :immediately move 4 to accumulator
add b ; add a & b

yuvaraj.tr -3 Newbie Poster

hi try this one
#include<iostream>
using namespace std;
class employee
{
int Id_no,No_days,age;
float salary;
char first_name[5],depat[5],gen[4],material[6];
public:
void capturenewemployee();
void employeedetails();
void searchemployee();
};
void employee :: capturenewemployee(void)
{
cout << "enter the firstname" << "\n" ;
cin >> first_name ;
cout << " enter age " << "\n" ;
cin >> age;
cout << " enter the Id_no" << "\n" ;
cin >> Id_no ;
cout << " enter the department " << "\n" ;
cin >> depat ;
cout <<" enter the gender" << "\n" ;
cin >> gen ;
cout << " enter material status" << "\n" ;
cin >> material ;
cout << " enter the No_days " << "\n" ;
cin >> No_days;
cout << " enter the salary" << "\n";
cin >> salary ;
}
void employee :: employeedetails(void)
{
cout <<" display result" << "\n";
cout << first_name << "\n";
cout << age << "\n";
cout << Id_no << "\n";
cout << depat << "\n";
cout << gen << "\n";
cout << material << "\n";
cout << No_days << "\n";
cout << salary << "\n";
}
void employee :: searchemployee(void)
{
cout <<" search result"<< "\n";
cout << first_name << "\n";
cout << age …

yuvaraj.tr -3 Newbie Poster

#include<stdio.h>
main()
{
int nu,i;
printf("enter the number");
scanf("%d",&nu);
for(i=0;i<=nu;i++)
{
printf("* \t");
}
printf("\n");
}
~

yuvaraj.tr -3 Newbie Poster

#include<stdio.h>
main()
{
int nu,i;
printf("enter the number");
scanf("%d",&nu);
for(i=0;i<=nu;i++)
{
printf("* \t");
}
printf("\n");
}
~

yuvaraj.tr -3 Newbie Poster

int sec_code;
printf("enter the sec_code");
scanf("%d",&sec_code);
while(sec_ocde < 0 && sec_code > 4 )
{
printf("invalid Sec_code \n please enter between 1 to 4 ");
}

yuvaraj.tr -3 Newbie Poster

Thank you

where can i download free embedded c compiler......for linux OS

yuvaraj.tr -3 Newbie Poster

Hi friends i am new to embedded domain. I would like to learn embedded C ,..

Where i get free books to learn embedded C..........
and whre i get free compilers to execute embedded c programms..........

I am using linux os..............

please help me.................

Advance Thanks for helping