Cprogramming.com - C++ Standard Library - String Class
Type: Posts; User: tenchu
Cprogramming.com - C++ Standard Library - String Class
Sorry about the conversation, we happened to know one another from somewhere else and randomly bumped into one another here. I was able to help one on one and explain things in detail.
We were...
I removed quoted code.
I think strings are really tricky. They are one of my most hated things to deal with. It takes some getting used to.
I don't see a PM yet, maybe I need more posts or maybe I am blind haha.
If you ever want to PM me you can PM me on JPM.
edit: deleted double post in case you missed it.
It works for me on Linux. What are you entering for the filename? You may not need to add the directory if it's in the same directory as the...
What you want is the answer I posted over in this other topic -> http://cboard.cprogramming.com/c-programming/132716-reading-proc-file-user-space.html
Except you want the user to enter the file...
You want something like this?
#include <stdio.h>
int main(){
FILE *fp = fopen("/proc/cpuinfo","r");
char c;
while (c != EOF){
Haha, on JPM I am Google. Or, The Yellow Brick Road when I wasn't banned.
Confused by what you wanted, feels like you're trying to do two things at once.
edit:
You should probably close...
Mikacho from JPM forums?
..}
You were capturing a single character, this declares an array of characters.
PS, if you want to deal with files you should learn how to open a file for...
A stream is a flow of continuous data. A buffer is a pool of data waiting to be read/wrote.
For example you stream video or audio over the internet. You can also buffer the stream by allowing a...
It's not people don't know how, it's most people don't care. If the problem only needs X efficiency and Y complexity then why use X^2 and half Y? It's overkill. It's like going to a gun fight with a...
I also recommend changing the variable name. It's alright to name it exit, but exit is also the name of a function exit(0); in one of the standard libraries. It could get confusing, so better to...
You didn't include the libraries correctly because you just copied and pasted the function from some file without knowing what you were doing. You can't include files like that.
You messed up...
Yes, my post was mostly meant as a joke but it does solve the problem. I think it makes more sense than the FAQ you linked and more than than switching the order of the comparison! At the end of the...
I never learned Windows API. I learned on Linux. I learned the standard libraries and then I learned most of the Linux libraries and then I learned some cross platform multimedia APIs etc.
I...
That looks more clear, nice catch!
Truth table - Wikipedia, the free encyclopedia
Read this and convert to C/C++ syntax...
This part is most useful:...
Good to know I am not the only one. Thanks!
True, but I was keeping the example short and sweet with a focus on the question/point about comparison operators. I edited the original in case it causes confusion.
Or we can get even quirkier!
Modified code from other help topic:
#include <stdio.h>
#define equals ==
void main(void){
int one, two, three;
printf("Enter 3 ints seperated by...
Learn how to use "and," by reading this: http://www.cprogramming.com/tutorial/lesson2.html
Then learn how to rock "?:" and then learn how to scan for 3 ints without writing 3 lines.
Here you...
Boilerplate, I learned a new word. Thanks!
I think I can wing it out and complete the program and then have some very helpful people help critique my techniques and help me organize my program...
I was curious about libraries as a base class. I don't think the library I am using would make a very good base class but I could be wrong.
I am also curious about implementing my own bases and...
Why use a number within a variable name? It can be quite confusing and I think it's bad practice. It is up to you though!
First the grievance, why on earth did they switch the order when using a typedef versus a pound define?
#define <newname> <what it equals>
typedef <what it equals> <newname>
I understand the...