User Profile

Collapse

Profile Sidebar

Collapse
aarthy82
aarthy82
Last Activity: Nov 5 '06, 05:41 PM
Joined: Nov 5 '06
Location: India
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aarthy82
    replied to nested structure
    in C
    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];...
    See more | Go to post

    Leave a comment:


  • aarthy82
    replied to nested structure
    in C
    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....
    See more | Go to post

    Leave a comment:


  • aarthy82
    replied to need help with a C program
    in C
    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...
    See more | Go to post

    Leave a comment:


  • aarthy82
    replied to One question only ---ANSI C
    in C
    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';...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...