poinet on struct corection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mitola
    New Member
    • Sep 2007
    • 17

    poinet on struct corection

    i know its easy to corect that mistakes but dunno i simply cant find them.

    14 new types may not be defined in a return type
    14 two or more data types in declaration of `vnos'

    [CODE=c]#include <stdlib.h>
    #include <stdio.h>
    #include <string.h>

    struct galaxy{
    char tokra[50];
    char tauri[50];
    char big[50];
    char small[50];
    }

    void vnos(struct galaxy sgw[])
    {
    struct galaxy *ksgw;ksgw=sgw;
    for(ksgw;ksgw<& sgw[2];ksgw++)
    printf("tokra name: ");
    scanf("%s",ksgw->tokra);
    printf("tauri name: "); scanf("%s",ksgw->tauri);
    /*printf("VNESI PRIIMEK IGRALCA: "); scanf("%s",kf->igralec.priime k);
    printf("VNESI ZANR: "); scanf("%s",kf->zanr);
    printf("VNESI LETO FILMA: "); scanf("%d",&kf->leto);*/
    }

    int main()
    {
    struct galaxy sgw[2], *ksgw;
    ksgw=&sgw[0];
    vnos(sgw);
    /*big;
    small;*/
    system("pause") ;
    return 0;
    }[/CODE]
    Last edited by Ganon11; Oct 29 '07, 01:18 AM. Reason: Please use the [CODE] tags provided.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Two things I notice:

    1) You're missing a semicolon after your struct definition.
    2) In your vnos function, your for loop is missing { } brackets, so only the first statement following it is repeated, but since it looks like you are initializing the values of the galaxy array, all of those statements need to be inside the loop.

    Comment

    Working...