Damn, I can't believe I didn't realize that! Rookie mistake. Hahaha. So there's no way to circumvent this?
Type: Posts; User: inu11byte
Damn, I can't believe I didn't realize that! Rookie mistake. Hahaha. So there's no way to circumvent this?
Well... I've just started programming in C again. I've been away from this beautiful language for far too long! Anyway, thought I'd brush up on a few very basic concepts, but it seems I've made a...
Well... you're right, I shouldn't cast it like that. I'll change the while to:
while((subs = fgetc(fp)) != ' ' && subs != '\n' && !feof(fp))
Any ideas on why I'm get unexpected results? Or more...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
void retrieveSubdomains(void);
int main(int argc, char *argv[])
Well, I'm trying to scan though a file 'subdomains.txt' and print out what's on each line seperately. E.g.
file contains:
this
file
means
nothing_to_you
I want each line to be printed...
Okay, so I'll start off by telling you what I am trying to do.
I have a text file that has words on each line. E.g.
this
is
a
test
forMyProgram
You can find a good video programming series on C, by Mark Virtue. If one was to search on tpb 'VTC c programming' and get the series done by Mark Virtue, the would be pleasantly surprised. There's...
Thank you, Salem. Can anybody answer my questions? Why could I pass an the argument 'argv[0]' into my original program? And why is the point of making a function a pointer?
Sorry, I don't get what you mean. I wanted my path 'C:\users\*****\Desktop\myfile.exe' to just be 'myfile.exe'.
Ah, just re-read your post. I was meaning argv[0], not argv[]. Sorry about the...
Never-mind, all is working well. Thank you very much! Could you tell me why my code wasn't working? Just out of curiosity. Also, why is the function base_name a pointer? Just curious.
Ah, forgot that the backslash was an escape character... Momentary lapse of knowledge... Hahaha. You're code looks good, but base_name() wont take argv[] as a parameter. :/
No, the above code doesn't work as I would like it to, but this code works:
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
_explode();
system("pause");...
Thanks for the quick reply, but it points to the result of strtok(). I haven't programmed in C for quite a long time, so I have picked up some bad habits. I think there's something wrong with how I'm...
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
_explode(argv[0]);
system("pause"); //Yes... I know this is bad.
return 0;
}
Okay, I'm sorry, I shouldn't have replied like that. :/ I understand you were just trying to help. Anyway, if I was shifting that variable to another area of memory, would that area of memory have to...
Are you ........ing kidding me? Where did you learn ASM?
Bellow is the example that I am going to use.
The bellow code should compile on GNU assembler. Syntax is AT&T incase any numbies are curious.
.data
HelloWorldString:
.asciz "Hello"
Can you use inline assembly? Or a simple messagebox. :cool:
Just a few things to note:
What is the 'i' variable being used for?
Void main is bad. Read more about why, here:void main(void) - the Wrong Thing
Thank you, I can't believe I was so stupid to miss that. Yeah, how I set out the header file isn't how it's 'supposed to be', but I did it for simplicity. I was going to move all unneeded code back...
I'm getting the following errors:
Files:
bot.h
I've been reading up on portable executables(Portable Executable - Wikipedia, the free encyclopedia), as they quite interest me. I would hate to have to compile my programs to work on different...
Why are you put and ampersand in front of your variable in the printf statement? Remove that, and your problems will be resolved.
My bad, I didn't proof read my post before posting it. I was meaning 'So, as long as I don't check processor specific options, my code should run on all Windows machines? Sorry for the seemingly...
Thank you very much, this was a prefect reply. So, as long as I check processor specific options, my code should run on all Windows machines? If I make a simple hello world program, it will run...