Jump to content

Recommended Posts

Posted

#include<iostream>

#include<string>

using namespace std;

class sir{

	char nume[80];

public:

	void punenume(char *n);

	void afiseaza(char *n);

};

void sir::punenume(char *n)

{

	strcpy_s(nume, n);

}

void sir::afiseaza(char *n)

{

	cout<< n;

}


int main()

{

	sir obiect;

	char nume[80];

	obiect.punenume("MARIA oprescu"); //se va apela metoda punenume

	obiect.afiseaza(nume); //afieaza "MARIA oprescu"

	system("PAUSE");

	return 0;

}

  • 4 weeks later...

  • 1 month later...
Posted

La strcpy_s!. In unele cazuri, in visual nu merge folosita strcpy.

Este o chestiune Microsoftista de "securitate". Functia strcpy_s a aparut in Visual Studio 2005 am impresia si s-a lasat cu multe coruperi pe stack la conversia programelor. :))

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.