[ create a new paste ] login | about

Link: http://codepad.org/jf7lkdXu    [ raw code | output | fork ]

C++, pasted on May 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>

void mouth(char **c){
	c[0]= "January";
	c[1]= "February";
	c[2]= "March";
	c[3]= "April";
	c[4]= "May";
	c[5]= "June";
}

int main()
{
	char name[6];	

    	mouth(name);

	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
cc1plus: warnings being treated as errors
In function 'void mouth(char**)':
Line 5: warning: deprecated conversion from string constant to 'char*''
Line 6: warning: deprecated conversion from string constant to 'char*''
Line 7: warning: deprecated conversion from string constant to 'char*''
Line 8: warning: deprecated conversion from string constant to 'char*''
Line 9: warning: deprecated conversion from string constant to 'char*''
Line 10: warning: deprecated conversion from string constant to 'char*''
In function 'int main()':
Line 17: error: cannot convert 'char*' to 'char**' for argument '1' to 'void mouth(char**)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: