Thanks for the anwers. But i think applying edit distance to this func would be a little bit overkill.. All i am seeking for is if the 3 same chars are near to each other, return 1.. I am kind of a...
Type: Posts; User: |HBO|
Thanks for the anwers. But i think applying edit distance to this func would be a little bit overkill.. All i am seeking for is if the 3 same chars are near to each other, return 1.. I am kind of a...
Hello guys..
I have this code which is for getting rid of every other character that is non-letters.
char *r(char *str)
{
char *src;
Thank you. (using the string 'string2' twice was my mistake.)
I changed the codes as
#include "string.h"
#include "stdio.h"
#define BAD(x) (!(x) || (*(x) == '\0'))
Sorry for being such a douche and double post. Since i wrote something new, i wanted to show you.
#include "string.h"
#include "stdio.h"
#define BAD(x) (!(x) || (*(x) == '\0'))
static...
Hi,
With the below function i can extract urls from strings. But it works with only "http://". So how can i change it to extract urls which begins with "www" also.
Thanks in advance.
Code...
Thank you.
Hi guys, i hope you're fine.
I am having a strange issue with the strcat. Let me explain:
name = getenv("LOGNAME");
strcat(output, name);
strcat(output, "..");
strcat(output,...
Oh thank you again.
input: 'john IBM has some secrets'
get: 'john IBM'
This is ok.
But i don't want to sscanf parse when the string goes like:
input: 'john IBM has some secrets'
sscanf still...
To sum it up you're saying it's not possible with sscanf? Right?
Sorry mates but i am in a dilemma now. So didn't want to create a new thread. Here i go:
What about space char? I mean
sscanf(s, "%s %s", name, company) parses a string like 'john nashville'...
Hi.
I am using:
int retcount (char * text)
{
char *tmp = text;
int count = 0
while (strtok(tmp, " "))
count++;
Thank you guys. Much appreciated.
Oh thank you for the quick reply. It works. But i should ask this. Is this normal if sscanf returns 1 when string like "#z-dot" or something?
hey mates.
i want to get two variables from a string that changes occasionally.
if (sscanf(s, "%s_%s", name, id) >= 1)
Long time no see. I am stuck with sth. How can i return a variable (char) from this function?
char c2h(const unsigned char *digest, int len)
{
static char dest[64];
char *ptr = dest;...
Thank you very much. i appreciate your help. I owe you one :)
Yes, i'm aware of that. I was gonna do that, though :) Thanks again for pointing that out.
Btw, it's my bad.
I just want to convert a md5 digest (such as Ëâغ%úB¶]) to hex value (such as cbe2d8ba9c25fa42b65d9d133e8c4c32)
it's OK with
for(i = 0; i < len; i++){
printf("%02x", digest[i]);
}...
Hi,
static char *tohex (const unsigned char *digest, int len) {
int i;
static char dest[64];
for(i = 0; i < len; i++){
strcat (dest, &digest[i]);
//printf("%02x", digest[i]);
Hi,
Is there a way to use forms with c? I have wrote a httpd server app but when i trying to pass a variable between pages (actually funcs) i am failing..
On the other hand, what do you think of...
Yep, i am using it with macros anyway.
Accidentally i found the problem. I have forgot using the socket pointer in the parsing function.Anyway, thanks to who helped and will help..
Nope my bad.I updated the code.Please take a look again.
I have wrote a simple program for connecting irc servers. It's Ok but the parsing is the thing that i am confused about.
During the main loop ( while (1) thing) when i try the parse the lines, the...
Thank you very much.
But this is the thing i am dealing with.I don't wanna it contains punctuation mark.(i meant the output must be isalnum char.)
Regards.
Thank you but it is not working.
for encryption:
char buf2[128];
char *buf1 = "hbo";
encrypt(buf1, buf2);
printf("Encrypted: %s\n", buf2);