Advertisement
Guest User

Untitled

a guest
Apr 16th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. printf(), fprintf(), wprintf() and NSlog() won't print on XCode
  2. wchar_t *polynomial_description( double *polyArray, char size, char var ){
  3.  
  4. wchar_t *descriptionString, temp[100];
  5. int len, counter = 0;
  6. SUPERSCRIPT superscript;
  7.  
  8. descriptionString = (wchar_t *) malloc(sizeof(wchar_t) * 2);
  9. descriptionString[0] = '';
  10.  
  11. while( counter < size ){
  12.  
  13. superscript = polynomial_utilities_superscript( size - counter );
  14. len = swprintf(temp, 100, L"%2.2f%c%c +", polyArray[counter], var, superscript);
  15. printf("temp size: %dn", len);
  16.  
  17. descriptionString = (wchar_t *) realloc(descriptionString, sizeof(wchar_t) * (wcslen(descriptionString) + len + 1) );
  18. wcscat(descriptionString, temp);
  19.  
  20. counter++;
  21.  
  22. }
  23.  
  24. //fflush(stdout); //Already tried this
  25. len = wprintf(L"%lsn", descriptionString);
  26. len = printf("%ls**n", descriptionString);
  27. len = fprintf(stdout, "%ls*n", descriptionString);
  28. len = printf("FFS!! Print something!");
  29.  
  30. return descriptionString;
  31.  
  32. }
  33.  
  34. int main(int argc, char **argv)
  35. {
  36. // Run "locale -a" in the Terminal to get a list of all valid locales
  37. setlocale(LC_ALL, "en_US.UTF-8");
  38. ...
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement