P
puzzlecracker
Here is a dummy program that outputs 4 instead of 200. I suspect it's
because it calculates the size of pointer on 32 bit machines instead
of array. Is there way to make it print 200? I need to pass the this
global variable via a function call. Thanks
#include<iostream>
#include<string>
using namespace std;
char array[200];
void func1(char *str){
cout<<"func1:"<<sizeof(str)<<endl;
}
int main(){
strcpy(array, "one.two");
func1(array);}
because it calculates the size of pointer on 32 bit machines instead
of array. Is there way to make it print 200? I need to pass the this
global variable via a function call. Thanks
#include<iostream>
#include<string>
using namespace std;
char array[200];
void func1(char *str){
cout<<"func1:"<<sizeof(str)<<endl;
}
int main(){
strcpy(array, "one.two");
func1(array);}