Here goes the program,
#include<iostre am.h>
#include<conio. h>
struct faculty
{
char fact1[50];
char fact2[50];
char fact3[50];
};
struct dean
{
char dean1[50];
char dean2[50];
char dean3[50];
};
struct seniorlecture
{
char seniorlec1[50];
char seniorlec2[50];
char seniorlec3[50];...
User Profile
Collapse
-
Hi There,
According to the declaration above you have a structure named faculty which has three members. Those members are of type character (i.e) it can hold only one character at a time. for (e.g) you can store uni.fact1='a';
So if you want to store a array of characters in fact1 you have to decalre fact1 as character array as
char fact1[50];
now
strcpy(uni.fact ,"Business") ; will work.
Try this....Leave a comment:
-
Hi there,
Here is the program which calculates the average of each row and column. See if it helps you,
#include<stdio. h>
int main()
{
int intArray[3][4]={{1,2,3,4},
{5,6,7,8},
{9,10,11,12}};
int i=0,j=0;
int sCol=0,sRow=0;
for(i=0;i<3;i++ )
{
for(j=0;j<4;j++ )
{
sRow=sRow+intAr ray[i][j];
}
printf("The...Leave a comment:
-
Hi there,
Here is a small code snippet that concatenates two strings. See if this works for you.
char *myCat(char *string1,char*s tring2)
{
char *tempBuf,*ret;
m=(char*)calloc (1,strlen(strin g1)+strlen(strl ing2)+1);
ret=tempBuf;
while(*string1! ='\0')
{
*tmpBuff++=*str ing1++;
}
while(*string2! ='\0')
{
*tmpBuff++=*str ing2++;
}
*tmpBuf='\0';...Leave a comment:
No activity results to display
Show More
Leave a comment: