Rozumiem że taki kod nie działa
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void funkcja(char *a)
{
cout << a;
}
int main(void)
{
const char * const szNapis = "hello from main";
funkcja(szNapis);
system("PAUSE>NUL");
return 0;
}
ale dlaczego takie coś działą???
<cpp>
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void funkcja(const char *a)
{
cout << a;
}
int main(void)
{
const char * const szNapis = "hello from main";
funkcja(szNapis);
system("PAUSE>NUL");
return 0;
}
Przecież wksaźnik też jest stały a parametr funkcji jest zwyczajnym wksaźnikiem na stałą [???]