July 27, 2004 | GPL Compliance for Software Developers | Example library based on libtriangle |
/*
Copyright 2004, Your Name Here Copyright 2003, Free Software Foundation
Libtriangle is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version. ...
2004-02-27, Your Name Here - added triangle2 based on triangle */
/* generalization of triangle (int) from libtriangle.c */ void triangle2 (int n, char c) {
int rows = 1 << n;
int i, j;
for (i = 0; i < rows; i ++) { for (j = 0; j < i; j ++) { printf (" "); } for (j = 0; j < rows; j ++) { if (i & j) printf (" "); else printf ("%c%c", c, c); } printf ("\n"); } }
Next: LGPL and non LGPL code in one library Previous Top |
![]() |
Copyright © 2004, Free Software Foundation. Verbatim copying permitted provided this notice is preserved. |