Actually don't. I'll look it up. Then I'll ask questions.
Type: Posts; User: ObjectWithBrain
Actually don't. I'll look it up. Then I'll ask questions.
Never heard of it. Could you explain a bit more? Thanks.
How would one go about implementing a function that took a variable and infinite number of parameters such as printf?
I really enjoyed that analogy salem. so you're saying that I don't need fstream or iomanip to deal with files? I was told I needed those. I don't know why i had string.h in there to tell you the...
okay I did it AGAIN. sorry. I missed the
answer = answerBuff; line.
It all works now. thanks guys. you're both great.
oh sorry looks like I missed some.
main.h
#include <string.h>
#include <iostream>
#include <fstream>
#include <iomanip>
#define HEADINGS "Employee Name Rate Hours Gross...
Okay, good to know. I fixed what I could see to fix, but there are still problems.
sorry about the c++ headers, I compile this as cpp but I don't really use anything that's c++ specific besides...
I've looked this up over and over and every post I come up with has something to do with Objective-C. Nobody has been able to tell me what it means. I am not writing Objective-C code, but I am using...
How would you make it read the password without displaying what you typed on the screen?
At 60 frames per second I'd be using 61.2kB per minute.
But I want to be able to pass the value of the buffer back through to main and I don't want to have to make a separate array outside of the function call just to do that. It just seems unnecessary....
So if the array is local to printBin(), like in the last version I showed which didn't work, is there any way to pass the value of binString (or buffer) without passing the pointer/array itself?...
Did I just pass an empty pointer? I remember reading that arrays are destroyed at the return of the function they're contained in, so does that mean that my pointer now points at nothing?
Okay, I got rid of that buffer, and now it stopped working. What did I do wrong? I guess I should make it a rule not to code past 1:00 AM.
#include <stdio.h>
char* printBin(unsigned...
Whoa, I just realized that my buffer doesn't contain anything. Why is it even there? I should get rid of it.
Pointers are insane. I swear, everytime I think I have them figured out, I run into...
Oh, okay now I understand exactly why it wasn't working for me. Like I said, the syntax is very confusing because of all of the *pointing-at-this and &containing-that and such.
So char *p = 'this'...
oh! it all clicks! it works now. thank you so much Andrew, you've saved me such a headache =)
My final code is
#include <stdio.h>
char buffer[17];
'1' saves an int to my buffer and gives me an incompatible integer to pointer conversion.
Didn't work. My code is now as follows:
#include <stdio.h>
char buffer[17];
char* printBin(unsigned short);
Ohh wow, I dont know what I was thinking using sscanf. I totally forgot what it does. Thanks for that.
So I should switch out sscanf() for = and then decrement binString by 16?
I'll give that a...
Im a noob to programming in general, and one of the biggest confusions I've had is with pointers in C. They make perfect sense to me conceptually, but syntactically they're incredibly confusing. I...