Jump to content

Малко помощ за С++


kevin

Препоръчан пост

Каква е грешката в тази програма? Моля ви помогнете.

 

#include "stdafx.h"
#include <iostream.h>

bool SayHello(char* szTo, int nCalc)
void SayGoodbye();

#define NUMERO_UNO 1
const char* OLD_FRIEND = "old friend, for now.";

int main(int argc, char* argv[])
{
char* szCpp = "C++!"

	if(SayHello(szCpp))
	{

		SayGoodbye();
	}
return 0;
}

bool SayHello(char* szTo, int nCalc)
{
cout << "Hello, " <<szTo<< " You're Number "
	 << NUMERO_UNO <<".\n";
return (nCalc + (nCalc * 2)) < 24/nCalc
}

void SayGoodbye()
{
cout << "Bye, " << OLD_FRIEND <<end1;
}

Link to comment
Сподели другаде

Ето така работи при мен:

#include <iostream.h>

bool SayHello(char* szTo, int nCalc);
void SayGoodbye();

#define NUMERO_UNO 1
const char* OLD_FRIEND = "old friend, for now.";

int main(int argc, char* argv[])
{
char* szCpp = "C++!";

	if(SayHello(szCpp,sizeof(szCpp)))
	{

		SayGoodbye();
	}
return 0;
}

bool SayHello(char* szTo, int nCalc)
{
cout << "Hello, " <<szTo<< " You're Number "
	 << NUMERO_UNO <<".\n";
return (nCalc + (nCalc * 2)) < 24/nCalc;
}

void SayGoodbye()
{
cout << "Bye, " << OLD_FRIEND <<endl;
}

Link to comment
Сподели другаде

На мен пак ми дава грешка.

 

$this_var ="c:\program files\microsoft visual studio\myprojects\hello1\hello1.cpp(36) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.";

Link to comment
Сподели другаде

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гост
Отговори на тази тема

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   Не можете да качите директно снимка. Качете или добавете изображението от линк (URL)

Loading...
×
×
  • Създай ново...