well i guess that solves it. Thanks!
Type: Posts; User: samus250
well i guess that solves it. Thanks!
There is a game on facebook in which you test how many keystrokes you can make in a minute. Of course I want to win. Is there any way to send keyboard signals to the system very very fast? I am on...
Cool way of doing buffered input. I tried to do it by dynamic allocation but failed miserably :-), I guess I learn something new every day. Thanks.
OK I am REALLY puzzled here.........
I test the program with the example input given on the site... which should output 4.
Why the heck does it give me 4 when I uncomment the commented printf,...
Reading with fread char by char is not good... time was 8.29 seconds (and I thought the time limit was 8, but it got accepted anyways).
#include <stdio.h>
int main()
{
char b;
...
Wow... I didn't check this thread since my last post...
I'll start reading with detail, I just browsed.
But what about using fread? Would that be faster somehow?
That's what I was thinking too.
I will, thing is that I modified it, so I'll make it again.
Also... any idea why is this code giving me a runtime error? (it's C)
#include <stdio.h>
int main() {
long n, k, i, ti,...
Well, the judge told me it took .05 seconds less...
Almost no difference with dynamic allocation, just .05 seconds faster.
Without dynamic allocation, the program takes 2.5M, with it the program takes 9.9M so storing all the input to memory first is...
Holy crap it worked!
Though there are people who do it even faster. Mine took 5.36 seconds (8 seconds is the time limit) and some people do it in about 3 seconds (others in less than 1...)
...
by using scanf("%ld", &x)? ... let's try that.
My other variation, which does not use dynamic memory allocation and also failed because of expired time limit.
#include <iostream>
using namespace std;
int main() {
long n, k, count...
I haven't been in these forums for a while... I've been learning much about Linux and about Perl and PHP :-)
I do know a lot of C, but not much C++, and I found a cool website that has an online...
Thanks tabstop. atexit() seems to work fine and it does what I need.
try this:
#include <stdio.h>
int main(void)
{
int a = 5;
char string[32] = "This is my string.";
I want my program to do something before it exists when the user presses the close (X) key on the command prompt. Is it possible? If so, how can I do that? Thanks!
P.S.: I'm on Windows
It works now. Thanks!
I want this program to scan a text file (given as an argument) and just put the alpha characters it finds. Why isn't it working? Thanks!
#include <stdio.h>
#include <ctype.h>
int main(int...
OK, I'll talk here because I'm 17 too and I started programming just a year ago with C. I bought myself "C All-in-one Desk Reference for Dummies", and took absolutely no classes. After finishing it,...
Daved: Yeah, that's what I was referring too.
About books:
I have Accelerated C++, but it is pretty accelerated hehe. And since it doesn't actually contrast between C and C++ then I had those...
Thanks a lot. C++ rocks.
I am new to C++. My biggest problem is that I already know C. I thought learning C++ would be super easy since I've got my 1 year experience in C, but it is not so.
Strings:
OK, what I understand...
Thanks a lot!
One small question about that ptrdiff_t type. What exactly will 'len' be, the size of bytes? Or would that depend on the types of pointers I'm subtracting?
'cause I just...
... oh and what do you mean by "block"?
And I don't know what a resource is.