Skip to content

Instantly share code, notes, and snippets.

@spellancer
Created April 20, 2012 05:55
Show Gist options
  • Save spellancer/2426449 to your computer and use it in GitHub Desktop.
Save spellancer/2426449 to your computer and use it in GitHub Desktop.
laba 5 finish C++
// Laba5.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
#include <locale.h>
extern "C" {
char* _cdecl ADD1 (int a,char *str);
void _cdecl print (int n)
{
cout << "Переданный параметр из ассемблера -- длина строки :" << n << endl;
};
}
int main()
{
setlocale (0,"russian");
int a,c,k,n,i;
int *t;
int *b;
char str[37], *str1;
k=1;
n=0;
cout<<"Введите строку для подсчета: "<<endl;
cin>>str;
a=strlen(str);
str1=ADD1(a,str);
cout<<"\nИсходная строка:"<<str<<endl;
cout<< "\nПолученная строка с результатом: "<<str1<<endl;
// вывод результата
n=strlen(str1);
system ("pause");
return 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment