Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
C/C++ - coppia if endif non corrispondente nel file
Forum - C/C++ - coppia if endif non corrispondente nel file

Avatar
matteog (Normal User)
Pro


Messaggi: 149
Iscritto: 10/04/2009

Segnala al moderatore
Postato alle 17:02
Domenica, 04/10/2009
Codice sorgente - presumibilmente C++

  1. #include "stdafx.h"
  2. #include <windows.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5. #include <time.h>
  6. #include <iostream>
  7. using namespace std;
  8. void frullino_stampa(bool in,bool out);
  9. void frullino_simula(bool*out,bool in);
  10. void frullinoimput(bool &in);
  11. #pragma comment(lib,"Winmm.lib")
  12. int tempoz[10];
  13.    
  14. void main()
  15. {
  16.        
  17.  
  18.         bool in;
  19.         bool out;
  20.         in=false;
  21.         out=true;
  22.         while(1)
  23.         {
  24.                 void frullinoinput(bool &in);
  25.                 void frullino_simula(bool &out,bool in);
  26.                 void frullino_stampa(bool in,bool out);
  27.         }
  28. }
  29. int frullinoinput(bool &in)
  30. {
  31.    
  32.         int tasto=0;
  33.         if( kbhit ())
  34.         {
  35.                 tasto=getch();
  36.         }
  37.         else
  38.         {
  39.                 tasto=-1;
  40.         }
  41.         if(tasto=='I')
  42.         {
  43.                 in=true;
  44.         }
  45.         else if(tasto=='i')
  46.         {
  47.                 in=false;
  48.         }
  49.        
  50. }
  51. void frullino_simula(bool*out,bool in)
  52. {
  53.         bool nandin2;
  54.         nandin2=*out;
  55.         *out=!(nandin2&&in);
  56. }
  57.  
  58. void frullino_stampa(bool in,bool out)
  59. {
  60.  
  61.         static long tempo=0;
  62.         int T_init;
  63.         static bool init=true;
  64.         static bool old_in,old_out;
  65.         if(init)
  66.         {
  67.                 printf(" t \t in \t out \t \n");
  68.                 T_init=timegettime();
  69.                 init=false;
  70.         }
  71.         else
  72.         {
  73.                 tempo=timegettime()-T_init;
  74.         }
  75.         if(init||old_in!=in||old_out!=out)
  76.         {
  77.                 init=false;
  78.                 printf("%d\t%d\t%d\n tempo,in,out");
  79.         }
  80.         old_in=in;
  81.         old_out=out;
  82. }




1>c:\programmi\microsoft sdks\windows\v6.0a\include\windows.h(253) : fatal error C1070: coppia #if/#endif non corrispondente nel file 'c:\programmi\microsoft sdks\windows\v6.0a\include\windows.h'


se premo sull'errore mi dà questa pagina che è la libreria del windows.h sapete aiutarmi?

Codice sorgente - presumibilmente C++

  1. /*++ BUILD Version: 0001    Increment this if a change has global effects
  2.  
  3. Copyright (c) Microsoft Corporation. All rights reserved.
  4.  
  5. Module Name:
  6.  
  7.  
  8.     windows.h
  9.  
  10. Abstract:
  11.  
  12.     Master include file for Windows applications.
  13.  
  14. --*/
  15.  
  16. #ifndef _WINDOWS_
  17. #define _WINDOWS_
  18.  
  19.  
  20. #include <sdkddkver.h>
  21.  
  22. #ifndef _INC_WINDOWS
  23. #define _INC_WINDOWS
  24.  
  25. #if defined (_MSC_VER) && (_MSC_VER >= 1020)
  26. #pragma once
  27. #endif
  28.  
  29. /*  If defined, the following flags inhibit definition
  30.  *     of the indicated items.
  31.  *
  32.  *  NOGDICAPMASKS     - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
  33.  *  NOVIRTUALKEYCODES - VK_*
  34.  *  NOWINMESSAGES     - WM_*, EM_*, LB_*, CB_*
  35.  *  NOWINSTYLES       - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
  36.  *  NOSYSMETRICS      - SM_*
  37.  *  NOMENUS           - MF_*
  38.  *  NOICONS           - IDI_*
  39.  *  NOKEYSTATES       - MK_*
  40.  *  NOSYSCOMMANDS     - SC_*
  41.  *  NORASTEROPS       - Binary and Tertiary raster ops
  42.  *  NOSHOWWINDOW      - SW_*
  43.  *  OEMRESOURCE       - OEM Resource values
  44.  *  NOATOM            - Atom Manager routines
  45.  *  NOCLIPBOARD       - Clipboard routines
  46.  *  NOCOLOR           - Screen colors
  47.  *  NOCTLMGR          - Control and Dialog routines
  48.  *  NODRAWTEXT        - DrawText() and DT_*
  49.  *  NOGDI             - All GDI defines and routines
  50.  *  NOKERNEL          - All KERNEL defines and routines
  51.  *  NOUSER            - All USER defines and routines
  52.  *  NONLS             - All NLS defines and routines
  53.  *  NOMB              - MB_* and MessageBox()
  54.  *  NOMEMMGR          - GMEM_*, LMEM_*, GHND, LHND, associated routines
  55.  *  NOMETAFILE        - typedef METAFILEPICT
  56.  *  NOMINMAX          - Macros min(a,b) and max(a,b)
  57.  *  NOMSG             - typedef MSG and associated routines
  58.  *  NOOPENFILE        - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
  59.  *  NOSCROLL          - SB_* and scrolling routines
  60.  *  NOSERVICE         - All Service Controller routines, SERVICE_ equates, etc.
  61.  *  NOSOUND           - Sound driver routines
  62.  *  NOTEXTMETRIC      - typedef TEXTMETRIC and associated routines
  63.  *  NOWH              - SetWindowsHook and WH_*
  64.  *  NOWINOFFSETS      - GWL_*, GCL_*, associated routines
  65.  *  NOCOMM            - COMM driver routines
  66.  *  NOKANJI           - Kanji support stuff.
  67.  *  NOHELP            - Help engine interface.
  68.  *  NOPROFILER        - Profiler interface.
  69.  *  NODEFERWINDOWPOS  - DeferWindowPos routines
  70.  *  NOMCX             - Modem Configuration Extensions
  71.  */
  72.  
  73. #if defined(RC_INVOKED) && !defined(NOWINRES)
  74.  
  75. #include <winresrc.h>
  76.  
  77. #else
  78.  
  79. #if defined(RC_INVOKED)
  80. /* Turn off a bunch of stuff to ensure that RC files compile OK. */
  81. #define NOATOM
  82. #define NOGDI
  83. #define NOGDICAPMASKS
  84. #define NOMETAFILE
  85. #define NOMINMAX
  86. #define NOMSG
  87. #define NOOPENFILE
  88. #define NORASTEROPS
  89. #define NOSCROLL
  90. #define NOSOUND
  91. #define NOSYSMETRICS
  92. #define NOTEXTMETRIC
  93. #define NOWH
  94. #define NOCOMM
  95. #define NOKANJI
  96. #define NOCRYPT
  97. #define NOMCX
  98. #endif
  99.  
  100. #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86)
  101. #define _X86_
  102. #endif
  103.  
  104. #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_AMD64)
  105. #define _AMD64_
  106. #endif
  107.  
  108. #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_M68K)
  109. #define _68K_
  110. #endif
  111.  
  112. #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_MPPC)
  113. #define _MPPC_
  114. #endif
  115.  
  116. #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_M_IX86) && !defined(_AMD64_) && defined(_M_IA64)
  117. #if !defined(_IA64_)
  118. #define _IA64_
  119. #endif // !_IA64_
  120. #endif
  121.  
  122. #ifndef _MAC
  123. #if defined(_68K_) || defined(_MPPC_)
  124. #define _MAC
  125. #endif
  126. #endif//
  127.  
  128. #if defined (_MSC_VER)
  129. #if ( _MSC_VER >= 800 )
  130. #ifndef __cplusplus
  131. #pragma warning(disable:4116)       // TYPE_ALIGNMENT generates this - move it
  132.                                     // outside the warning push/pop scope.
  133. #endif
  134. #endif
  135. #endif
  136.  
  137. #ifndef RC_INVOKED
  138. #if     ( _MSC_VER >= 800 )
  139. #pragma warning(disable:4514)
  140. #ifndef __WINDOWS_DONT_DISABLE_PRAGMA_PACK_WARNING__
  141. #pragma warning(disable:4103)
  142. #endif
  143. #if _MSC_VER >= 1200
  144. #pragma warning(push)
  145. #endif
  146. #pragma warning(disable:4001)
  147. #pragma warning(disable:4201)
  148. #pragma warning(disable:4214)
  149. #endif
  150. #include <excpt.h>
  151. #include <stdarg.h>
  152. #endif /* RC_INVOKED */
  153.  
  154. #include <windef.h>
  155. #include <winbase.h>
  156. #include <wingdi.h>
  157. #include <winuser.h>
  158. #if !defined(_MAC) || defined(_WIN32NLS)
  159. #include <winnls.h>
  160. #endif
  161. #ifndef _MAC
  162. #include <wincon.h>
  163. #include <winver.h>
  164. #endif
  165. #if !defined(_MAC) || defined(_WIN32REG)
  166. #include <winreg.h>
  167. #endif
  168. #ifndef _MAC
  169. #include <winnetwk.h>
  170. #endif
  171.  
  172.  
  173. #include <cderr.h>
  174. #include <dde.h>
  175. #include <ddeml.h>
  176. #include <dlgs.h>
  177. #ifndef _MAC
  178. #include <lzexpand.h>
  179. #include <mmsystem.h>
  180. #include <nb30.h>
  181. #include <rpc.h>
  182. #endif
  183. #include <shellapi.h>
  184. #ifndef _MAC
  185. #include <winperf.h>
  186. #include <winsock.h>
  187. #endif
  188. #ifndef NOCRYPT
  189. #include <wincrypt.h>
  190. #include <winefs.h>
  191. #include <winscard.h>
  192. #endif
  193.  
  194. #ifndef NOGDI
  195. #ifndef _MAC
  196. #include <winspool.h>
  197. #ifdef INC_OLE1
  198. #include <ole.h>
  199. #else
  200. #include <ole2.h>
  201. #endif /* !INC_OLE1 */
  202. #endif /* !MAC */
  203. #include <commdlg.h>
  204. #endif /* !NOGDI */
  205.  
  206. #include <stralign.h>
  207.  
  208. #ifdef _MAC
  209. #include <winwlm.h>
  210. #endif
  211.  
  212.  
  213. #ifdef INC_OLE2
  214. #include <ole2.h>
  215. #endif /* INC_OLE2 */
  216.  
  217. #ifndef _MAC
  218. #ifndef NOSERVICE
  219. #include <winsvc.h>
  220. #endif
  221.  
  222. #if(WINVER >= 0x0400)
  223. #ifndef NOMCX
  224. #include <mcx.h>
  225. #endif /* NOMCX */
  226.  
  227. #ifndef NOIME
  228. #include <imm.h>
  229. #endif
  230. #endif /* WINVER >= 0x0400 */
  231. #endif
  232.  
  233. #ifndef RC_INVOKED
  234. #if     ( _MSC_VER >= 800 )
  235. #if _MSC_VER >= 1200
  236. #pragma warning(pop)
  237. #else
  238. #pragma warning(default:4001)
  239. #pragma warning(default:4201)
  240. #pragma warning(default:4214)
  241. /* Leave 4514 disabled.  It's an unneeded warning anyway. */
  242. #endif
  243. #endif
  244. #endif /* RC_INVOKED */
  245.  
  246. //#endif /* RC_INVOKED */
  247.  
  248. #endif /* _INC_WINDOWS */
  249. #endif /* _WINDOWS_ */


Ultima modifica effettuata da pierotofy il 04/10/2009 alle 18:15
PM Quote
Avatar
theprogrammer (Normal User)
Guru^2


Messaggi: 2509
Iscritto: 28/01/2009

Segnala al moderatore
Postato alle 17:20
Domenica, 04/10/2009
Prima di tutto, il titolo deve essere conciso ed efficace, non serve per aggiungere commenti ...

E poi, rispetto a tutti gli errori che avevi prima, questo e' un errore "diverso" ... o no?

Ti avevo detto che

void frullinoimput(bool &in);

doveva essere

void frullinoimput(bool *in);

perche' il parametro e' un puntatore, ma non hai cambiato nulla (a parte che ti avevo suggerito input in inglese e non imput e la cosa non ti ha neanche sfiorato ...).

Poi vedo che chiami le funzioni (all'interno della while) con

        void frullinoinput(bool &in);
        void frullino_simula(bool &out,bool in);
        void frullino_stampa(bool in,bool out);

e questo vuol dire che non hai capito ancora nulla della sintassi di base del C.

A questo punto, non ha senso dare suggerimenti se non li segui. La programmazione non e' per tutti.


PM Quote
Avatar
matteog (Normal User)
Pro


Messaggi: 149
Iscritto: 10/04/2009

Segnala al moderatore
Postato alle 18:08
Domenica, 04/10/2009
8-)GRAZIE MILLE DI CUORE VISTO CHE PER TE è GRADITO TI RINGRAZIO ANCHE SE LA TUA RISPOSTA è UN CHIARO ESEMPIO DI COME EVITARE DI RISPONDERE QUANDO NN SI Sà QUALCOSA,PIACERE DI AVERTI CONOSCIUTO E GRAZIE!

PM Quote
Avatar
pierotofy (Admin)
Guru^2


Messaggi: 6230
Iscritto: 04/12/2003

Segnala al moderatore
Postato alle 18:15
Domenica, 04/10/2009
Metteog, theprogrammer ti ha dato delle indicazioni utilissime e coerenti. Quello che non sa come ci si comporta in un forum mi sembra sia proprio tu.

Ora fine dell'off-topic e da ora in poi solo messaggi rilevanti al topic. Altrimenti chiudo.

p.s. modificato il titolo.

Ultima modifica effettuata da pierotofy il 04/10/2009 alle 18:16


Il mio blog: https://piero.dev
PM Quote
Avatar
theprogrammer (Normal User)
Guru^2


Messaggi: 2509
Iscritto: 28/01/2009

Segnala al moderatore
Postato alle 19:13
Domenica, 04/10/2009
Testo quotato

Postato originariamente da matteog:

8-)GRAZIE MILLE DI CUORE



A parte questa risposta "scomposta" (che mi aspettavo ...), non mi sai dire nulla circa i suggerimenti che ti avevo dato e quanto ti ho scritto sulla chiamata delle funzioni nel while?

E dato che ci siamo, quale compilatore/IDE (con la versione) stai utilizzando? E hai fatto tutti gli aggiornamenti (con Windows Update) di tale compilatore/IDE?

PM Quote