![]() |
|
#1
|
|||
|
|||
How can I solve this errorI writed down this program
[c] #include<conio.h> #include<stdio.h> main() { clrscr(); struct data { char name[3][10]; char mail[3][40]; char no[3][10]; }a1,a2; printf("\nEntr the name:"); goto end; //intring the data of the name for(int c=0;c<=2;c++) scanf("%s",a1.name[c]); printf("\nEntr the mails:"); //intring the data of the name for( c=0;c<=2;c++) scanf("%s",a1.mail[c]); printf("\nEntr the Numbers:"); //intring the data of the name for( c=0;c<=2;c++) scanf("%s",a1.no CPP / C++ / C Code:
the first goto in my code (goto end) give compilation error : goto hypasses intialization of local variable. How can I solve that, because it appeared to me again in a nother code |
|
#2
|
|||
|
|||
Re: How can I solve this errorHi,
There's no error on goto, besides use a goto. You should never use goto if is possible to avoid, and always is possible, at least that's my opinion. Goto makes very difficult to find errors in code related with it. However, there's other errors:
__________________
Please, correct me if I'm wrong, and sorry for my english ;) |
Recent GIDBlog
Flickr uploads of IA pictures by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 10:13 |
| Linked Lists advice request | promsan | C Programming Language | 74 | 23-May-2007 08:29 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 11:25 |
| Winsock error when compiling FLTK 2.0 Projects | mauriciorossi | FLTK Forum | 3 | 16-Aug-2005 10:18 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 20:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The