Permalink
Browse files

new chapter strings

  • Loading branch information...
rafiks committed Jan 1, 2013
1 parent f2c7caf commit a687fe724ef3e81c503c09ffc2ad52ab91c28297
View
BIN .DS_Store
Binary file not shown.
View
BIN deal
Binary file not shown.
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.deal</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
Submodule gdb added at df2c9e
View
BIN getc
Binary file not shown.
View
10 getc.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+int main(int argc, const char *argv[])
+{
+ int c;
+ while ((c = getchar()) != EOF) {
+ putchar(c);
+ }
+ return 0;
+}
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.getc</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
@@ -0,0 +1,34 @@
+#include <ctype.h>
+#include <stdio.h>
+
+int getch(void);
+void ungetch(int);
+
+int main(int argc, const char *argv[])
+{
+ getint(1233);
+ return 0;
+}
+int getint(int *pn){
+ int c, sign;
+
+ while (isspace(c = getch())) {
+ ;
+ }
+ if (!isdigit(c) && c != EOF && c != '+' && c != '-') {
+ ungetch(c);
+ return 0;
+ }
+ sign = (c == '-') ? -1 : 1;
+ if (c == '+' || c == '-') {
+ c = getch();
+ }
+ for (*pn = 0; isdigit(c); c = getch()) {
+ *pn *= 10 * *pn + (c - '0');
+ }
+ *pn *= sign;
+ if (c != EOF) {
+ ungetch(c);
+ }
+ return c;
+}
View
BIN hello
Binary file not shown.
View
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, const char *argv[])
+{
+ printf("hello, world\n");
+ return 0;
+}
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.hello</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.lexi-gdb-mac</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.lexi</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
BIN ptr-test
Binary file not shown.
View
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+void swap(int *x, int *y);
+
+int main(int argc, const char *argv[])
+{
+ int x = 1;
+ int y = 2;
+
+ swap(&x, &y);
+ return 0;
+}
+
+void swap(int *x, int *y){
+ int temp;
+
+ temp = *x;
+ *x = *y;
+ *y = temp;
+}
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.ptr-test</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
@@ -0,0 +1,50 @@
+#include <stdio.h>
+#include <string.h>
+
+#define MAXLINES 5000
+
+char *lineptr[MAXLINES]; /*this means that this is an array of Maxline ,with each element is a pointer to a char */
+
+int readlines(char *lineptr[], int nlines);
+void writelines(char *lineptr[], int nlines);
+
+void qsort(char *lineptr[], int left, int right);
+
+/* sort input lines */
+
+int main(int argc, const char *argv[])
+{
+ int nlines;
+
+ if ((nlines = readlines(lineptr, MAXLINES)) >= 0) {
+ qsort(lineptr, 0, nlines -1);
+ writelines(lineptr, nlines);
+ return 0;
+ } else {
+ printf("error: input too big to sort\n");
+ return 1;
+ }
+ return 0;
+}
+
+#define MAXLEN 1000 /* max length of input line */
+
+int gtline(char *, int);
+char *alloc(int);
+
+int readlines(char *lineptr[], int maxlines)
+{
+ int len, nlines;
+ char *p, line[MAXLEN];
+
+ nlines = 0;
+ while ((len = gtline(line,MAXLEN)) > 0) {
+ if (nlines >= maxlines || (p = alloc(len)) == NULL) {
+ return -1;
+ } else {
+ line[len-1] = '\0';
+ strcpy(p, line);
+ lineptr[nlines++] = p;
+ }
+ }
+}
View
No changes.
View
BIN temp
Binary file not shown.
View
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+/* print Fahrenheit-celsius table
+ * for fahr = 0,20, ...,300 */
+int main(int argc, const char *argv[])
+{
+ float fahr, celsius;
+ int lower, upper, step;
+
+ lower = 0;
+ upper = 300;
+ step = 20;
+
+ fahr = lower;
+ printf("F\tC\n");
+ while (fahr <= upper) {
+ celsius = (5.0/9.0) * (fahr - 32.0);
+ printf("%3.0f %6.1f\n", fahr, celsius);
+ fahr = fahr + step;
+ }
+ return 0;
+}
View
21 temp.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+/* print Fahrenheit-celsius table
+ * for fahr = 0,20, ...,300 */
+int main(int argc, const char *argv[])
+{
+ int fahr, celsius;
+ int lower, upper, step;
+
+ lower = 0;
+ upper = 300;
+ step = 20;
+
+ fahr = lower;
+ while (fahr <= upper) {
+ celsius = 5 * (fahr - 32) / 9;
+ printf("%d\t%d\n", fahr, celsius);
+ fahr = fahr + step;
+ }
+ return 0;
+}
View
@@ -0,0 +1,3 @@
+I am Blaxxon,
+the cosmic computer.
+Fear me.
View
BIN writetxt
Binary file not shown.
View
@@ -0,0 +1,31 @@
+#include <iostream>
+#include <fstream>
+#include "string"
+using namespace std;
+
+int main() {
+ char filename[81];
+ char directory[81];
+ char file[81];
+
+ cout << "Enter a file name and press ENTER: ";
+ cin.getline(filename, 80);
+ cout << "Enter a directory and press ENTER: ";
+ cin.getline(directory, 80);
+
+ /*strncpy(file,directory);
+ strcat(file,filename);*/
+ strcpy(file,directory);
+ strcat(file,filename);
+ ofstream file_out(file);
+ if (! file_out) {
+ cout << "File " << file << " could not be opened.";
+ return -1;
+ }
+ cout << "File " << file << " was opened.";
+ file_out << "I am Blaxxon," << endl;
+ file_out << "the cosmic computer." << endl;
+ file_out << "Fear me.";
+ file_out.close();
+ return 0;
+}
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.writetxt</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.zero_out_mac</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.zero_prt_mac</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
Binary file not shown.

0 comments on commit a687fe7

Please sign in to comment.