Oppure

Loading
04/10/09 15:02
matteog
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <iostream>
using namespace std;
void frullino_stampa(bool in,bool out);
void frullino_simula(bool*out,bool in);
void frullinoimput(bool &in);
#pragma comment(lib,"Winmm.lib")
int tempoz[10];
    
void main()
{
       

	bool in;
	bool out;
	in=false;
	out=true;
	while(1)
	{
		void frullinoinput(bool &in);
		void frullino_simula(bool &out,bool in);
		void frullino_stampa(bool in,bool out);
	}
}
int frullinoinput(bool &in)
{
   
	int tasto=0;
	if( kbhit ())
	{
		tasto=getch();
	}
	else
	{
		tasto=-1;
	}
	if(tasto=='I')
	{
		in=true;
	}
	else if(tasto=='i')
	{
		in=false;
	}
	
}
void frullino_simula(bool*out,bool in)
{
	bool nandin2;
	nandin2=*out;
	*out=!(nandin2&&in);
}

void frullino_stampa(bool in,bool out)
{

	static long tempo=0;
	int T_init;
	static bool init=true;
	static bool old_in,old_out;
	if(init)
	{
		printf(" t \t in \t out \t \n");
		T_init=timegettime();
		init=false;
	}
	else
	{
		tempo=timegettime()-T_init;
	}
	if(init||old_in!=in||old_out!=out)
	{
		init=false;
		printf("%d\t%d\t%d\n tempo,in,out");
	}
	old_in=in;
	old_out=out;
}





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?

/*++ BUILD Version: 0001    Increment this if a change has global effects

Copyright (c) Microsoft Corporation. All rights reserved.

Module Name:


    windows.h

Abstract:

    Master include file for Windows applications.

--*/

#ifndef _WINDOWS_
#define _WINDOWS_


#include <sdkddkver.h>

#ifndef _INC_WINDOWS
#define _INC_WINDOWS

#if defined (_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/*  If defined, the following flags inhibit definition
 *     of the indicated items.
 *
 *  NOGDICAPMASKS     - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
 *  NOVIRTUALKEYCODES - VK_*
 *  NOWINMESSAGES     - WM_*, EM_*, LB_*, CB_*
 *  NOWINSTYLES       - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
 *  NOSYSMETRICS      - SM_*
 *  NOMENUS           - MF_*
 *  NOICONS           - IDI_*
 *  NOKEYSTATES       - MK_*
 *  NOSYSCOMMANDS     - SC_*
 *  NORASTEROPS       - Binary and Tertiary raster ops
 *  NOSHOWWINDOW      - SW_*
 *  OEMRESOURCE       - OEM Resource values
 *  NOATOM            - Atom Manager routines
 *  NOCLIPBOARD       - Clipboard routines
 *  NOCOLOR           - Screen colors
 *  NOCTLMGR          - Control and Dialog routines
 *  NODRAWTEXT        - DrawText() and DT_*
 *  NOGDI             - All GDI defines and routines
 *  NOKERNEL          - All KERNEL defines and routines
 *  NOUSER            - All USER defines and routines
 *  NONLS             - All NLS defines and routines
 *  NOMB              - MB_* and MessageBox()
 *  NOMEMMGR          - GMEM_*, LMEM_*, GHND, LHND, associated routines
 *  NOMETAFILE        - typedef METAFILEPICT
 *  NOMINMAX          - Macros min(a,b) and max(a,b)
 *  NOMSG             - typedef MSG and associated routines
 *  NOOPENFILE        - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
 *  NOSCROLL          - SB_* and scrolling routines
 *  NOSERVICE         - All Service Controller routines, SERVICE_ equates, etc.
 *  NOSOUND           - Sound driver routines
 *  NOTEXTMETRIC      - typedef TEXTMETRIC and associated routines
 *  NOWH              - SetWindowsHook and WH_*
 *  NOWINOFFSETS      - GWL_*, GCL_*, associated routines
 *  NOCOMM            - COMM driver routines
 *  NOKANJI           - Kanji support stuff.
 *  NOHELP            - Help engine interface.
 *  NOPROFILER        - Profiler interface.
 *  NODEFERWINDOWPOS  - DeferWindowPos routines
 *  NOMCX             - Modem Configuration Extensions
 */

#if defined(RC_INVOKED) && !defined(NOWINRES)

#include <winresrc.h>

#else

#if defined(RC_INVOKED)
/* Turn off a bunch of stuff to ensure that RC files compile OK. */
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86)
#define _X86_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_AMD64)
#define _AMD64_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_M68K)
#define _68K_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_MPPC)
#define _MPPC_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_M_IX86) && !defined(_AMD64_) && defined(_M_IA64)
#if !defined(_IA64_)
#define _IA64_
#endif // !_IA64_
#endif

#ifndef _MAC
#if defined(_68K_) || defined(_MPPC_)
#define _MAC
#endif
#endif//

#if defined (_MSC_VER)
#if ( _MSC_VER >= 800 )
#ifndef __cplusplus
#pragma warning(disable:4116)       // TYPE_ALIGNMENT generates this - move it
                                    // outside the warning push/pop scope.
#endif
#endif
#endif

#ifndef RC_INVOKED
#if     ( _MSC_VER >= 800 )
#pragma warning(disable:4514)
#ifndef __WINDOWS_DONT_DISABLE_PRAGMA_PACK_WARNING__
#pragma warning(disable:4103)
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4001)
#pragma warning(disable:4201)
#pragma warning(disable:4214)
#endif
#include <excpt.h>
#include <stdarg.h>
#endif /* RC_INVOKED */

#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#if !defined(_MAC) || defined(_WIN32NLS)
#include <winnls.h>
#endif
#ifndef _MAC
#include <wincon.h>
#include <winver.h>
#endif
#if !defined(_MAC) || defined(_WIN32REG)
#include <winreg.h>
#endif
#ifndef _MAC
#include <winnetwk.h>
#endif


#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#include <winsock.h>
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#include <winefs.h>
#include <winscard.h>
#endif

#ifndef NOGDI
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#include <commdlg.h>
#endif /* !NOGDI */
 
#include <stralign.h>

#ifdef _MAC
#include <winwlm.h>
#endif


#ifdef INC_OLE2
#include <ole2.h>
#endif /* INC_OLE2 */

#ifndef _MAC
#ifndef NOSERVICE
#include <winsvc.h>
#endif

#if(WINVER >= 0x0400)
#ifndef NOMCX
#include <mcx.h>
#endif /* NOMCX */

#ifndef NOIME
#include <imm.h>
#endif
#endif /* WINVER >= 0x0400 */
#endif

#ifndef RC_INVOKED
#if     ( _MSC_VER >= 800 )
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4001)
#pragma warning(default:4201)
#pragma warning(default:4214)
/* Leave 4514 disabled.  It's an unneeded warning anyway. */
#endif
#endif
#endif /* RC_INVOKED */

//#endif /* RC_INVOKED */

#endif /* _INC_WINDOWS */
#endif /* _WINDOWS_ */







Ultima modifica effettuata da pierotofy 04/10/09 16:15
aaa
04/10/09 15:20
theprogrammer
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.

aaa
04/10/09 16:08
matteog
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!
aaa
04/10/09 16:15
pierotofy
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 04/10/09 16:16
Il mio blog: piero.dev
04/10/09 17:13
theprogrammer
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?
aaa