These are chat archives for learnclang/general
Having gone through a few more videos, and reached the first assignment, it looks as though we'd have to implement the language in either C++ or Java, both of which are a little out of my depth at the moment, so I'm thinking we should wait with this until a little further ahead.
The assignment is here:
Does anyone know how to do some sort of introspection with C?
>>> import os >>> print os <module 'os' from '/usr/lib/python2.7/os.pyc'>
This, for example, prints the location of where a particular module is located at, can I do the same with C?
>>> help(os.path) Help on module posixpath: NAME posixpath - Common operations on Posix pathnames. FILE /usr/lib/python2.7/posixpath.py ...
This prints a comment out of the module, can C do that?
Primarily, I'm interested in figuring out where functions come from, as they all appear in the global namespace. Such as:
#include <ctype.h> for (i=0; isspace(s[i]); i++);
isspace coming from
ctype.h or is it part of the language?
$ a.out | myfile.txt
my_program < input >> output
marcus@ubuntu:~/github/kandr/builds$ ./1-21 | ~/spaces.txt bash: /home/marcus/spaces.txt: Permission denied
I guess in that case, it's from one to the other, and not the other way around.
What do you mean?
$ program1 | program2
program2 passes it's results into
program2to receive data from
program1, if I understand it correctly
program2has to finish before
program1can get anything..
< FILENAME # Accept input from a file. | # Pipe. # General purpose process and command chaining tool.