Hi, all. I need someone to confirm that I've got this precedence right below please. Let's say I have a pointer p pointing to some valid stuff somewhere. Then:
if (*p++ == 12)
is the same...
Type: Posts; User: fanoliv
Hi, all. I need someone to confirm that I've got this precedence right below please. Let's say I have a pointer p pointing to some valid stuff somewhere. Then:
if (*p++ == 12)
is the same...
How is this different from a regular #define that's just on it's own? Does containing the #define within the struct definitions means that you can't assign the #define constant to other things...
Thanks for your help. Figured it out finally.
Is there a reason why I can't open a .exe file with fopen? I've got a function that's supposed to copy some files. It's copying all kinds of files fine (e.g. .doc, .htm, .asm, .inc). But I get an...
Yes, I'm afraid I am using a 16bit compiler. It's Borland C++ 4.5, I think, but set to compile in 16-bit mode. Does that mean that I can't do anything about the folder name being uppercase? Thanks....
Hi. When I call mkdir to make a directory, the directory that gets created has a name all in uppercase, even though the string I specified in mkdir is lowercase. Can anyone please tell me how I can...
How about opening or closing a folder? Like you do fopen to open a file right? Is that apply to folders too? Or do i just specify the folder as part of a path then look for files in there?
Also,...
Can someone please tell me what is the difference between files and folder as far as when I am using findfirst and findnext?
If I'm trying to see if my the current folder contains a subfolder, do...
Thanks for your help. Just found out I'm not supposed to use the system() call. So now I have a new problem of trying to copy files and folders manually. Still figuring out how to do that.
I have some string buffers that are maximum of 600 characters. All of them together shouldn't exceed 5k bytes, I'd say. So how is it possible to run out of memory?
Ok...figured it out. Sorry to waste all your time. The problem was when I was reading using fgets. I was reading correctly, but was reading into the wrong buffer, which in the process changed Line to...
Ok...sorry about that. I figured out that the Line and Buffer are actually pointing to the same address all along (I was reading the addresses wrong earlier). So I guess now my question is, why are...
I'm trying to issue a system call from my program. However, when I run the program, I get the message "Program too big to fit in memory"
Does anyone have any idea why this is, and how I might fix...
What I tried above didn't help, actually. My Buffer is still messed up after I free the Line pointer. Now my code is like this.
int PutSthInBuffer (unsigned char *Buffer, int length) {
...
My mistake about the declaration. I've fixed the snippet above and added stuff you suggested.
As for the addresses of the pointers after the strcpy call, they're still the same as they were...
I thought the prototype for gets is char *gets(char *s)? How come you can call it like that? Are you sure your program compiles? I'd like to know what the experts on here says about this. More new...
I'm having some problem with the strcpy function. Hopefully some of you can point out what I'm doing wrong please.
Basically, I'm calling a function to read a file and put something in an output...
Sorry to bother you guys. I figured out the problem is in another part of the program, which I was passing the wrong file name to fopen. Thanks.
Hi, I'm having some troubles with openning a file that I need to read. I think it's because I'm handling the FILE* wrong or something. But I'm a little confused about this. Hopefully someone can...
Was here, sixth post down.
http://cboard.cprogramming.com/showthread.php?t=77944&highlight=free+null
Really? Well, I was just searching through these forums actually. Looks like I'll have to be more careful next time. Thanks a lot for your reply.
sorry for this thread, after more looking around, I found out free(NULL) would indeed crash the program. Thanks.
If I call free(NULL) or free(ptr) where ptr == NULL, will it crash the program or not compile?
I'd try it out myself, except there isn't really an easy place in my existing code to do it and I'd...
lol...my boss is a pretty nice guy actually. And I'm sure he knows a lot more than I do about programming. Thanks for the clarification though.
Actually, let me clarify. I don't think they're supposed to work the same. In fact, I think calling strtok with the first version
ptr = strtok (originalStr, "");
would set ptr to point to...