Filter string in C
How can I filter a string in c? I want to remove anything that isn't [a-z0-9_]. int main(int argc, char ** argv) { char* name = argv[1]; // remove anything that isn't [a-z0-9_] printf("%s", name); } ...
How can I filter a string in c? I want to remove anything that isn't [a-z0-9_]. int main(int argc, char ** argv) { char* name = argv[1]; // remove anything that isn't [a-z0-9_] printf("%s", name); } ...
Sometimes I see header files of the form. #include <sys/sysinfo.h> // I found this on my system under /usr/include/sys/sysinfo.h. Is that all the "sys/" means? What is this called and why are these header files different from most others like #include <stdio.h> Maybe a g...
Hi all! Can anyone guide me what could be the problem in the mentioned below:- This PP folder is present in the following path at my desk "E:\WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V2_PDK1_7\IPUV3" In this IPUV3 folder, PP folder is present which does the resize,rotation & conversion task of an image. This PP folder consists of...
template <int T> void aFunc(){} int main() { int anArray[45-32]; switch(4) { case 4<45: break; } aFunc<4*3/7&8 == 45 - 5>(); } so this all compiles in VC++ 2005 is this standard? if so, what do the conditional operators return? 0 and 1? are there limits? and the thing that interests me the most, can...
Hello everyone, i declare a global variable and use and modify its value in the function. Then i want to get the modified value of this global variable, it has some problem. Can anyone help me? #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> #define MAX 10 struct link { int freq; char va...
I have a dll with following signature in C++. It is working in c++; void Decompress(unsigned char *in,int in_len,unsigned char * out, unsigned *o_len,int *e); Description of parameter *in : It is byte array passed to fucntion. in_len : Length of bytes in first parameter. *out : This would be the output as byte array. *o_len : N...
Hi all, I want to know the difference between the file descriptor and file pointer.And also which is efficient in scenarios. ...
I'm accessing my memory-mapped device via a device-specific physical memory on the PC. This is done using a driver that maps a specific physical address to a pointer in linear memory on my process address space. I wanted to know if there is any way I can obtain a block the specific physical address and prevent other processes or devices...
I stumbled across this C code today. Can anyone tell me what the 'where' keyword means: *y = sy + exit->y + (where * (entry->y + esy - exit->y)); Edit: Ah.. my bad. It is just a variable name. VC++ highlighted it as though it was a keyword though. ...
Hi, I have a client/server program in TCP written in C, and I would like to secure the exchanged data with OpenSSL, it's quite new for me and I couldn't find examples on the net... Could you point out some googd documentation on this matter please? Thank you! ...
I need to determin the byte size of a file. The coding language is C++ and the code should work with Linux, windows and any other operating system. This implies using standard C or C++ functions/classes. This trivial need has apparently no trivial solution. ...
I have little doubt about string reading in C. string reading functions like gets, scanf, read, fscanf , fgets... which C function can do a secure or safe string reading from any file? Or Which C function can be reliable to read a string in a file ? ...
Hello, gcc 4.4.2 I have the following code: char channels[] = "NumberOfChannel = [2]"; sscanf(channels, "%*[^=]= %d", &chan); I am wondering what this means. As far as I can tell. It is ignoring the equals sign. '^ ignore the character =' Would that be correct? Many thanks, ...
Hi All, I wrote this tiny code: #include <stdio.h> int main() { size_t temp; temp = 100; printf("lld=%lld, ld=%ld, u=%u\n", temp, temp, temp); return 0; } I am running this on a i386 GNU/Linux machine with gcc version 4.1.1 20070105 (Red Hat 4.1.1-52). This is the output that I got: lld=429496729700, ld=100, u=7993...
I have the following code int main() { int a=6; void *p; p=&a; p++; } Does the void pointer here increment by a particular value (if it is holding the address of any data type) ? In the above case p increments by 1 even though it is pointing to an integer value. According to me the above code invokes Implementation Define...
In my C program I want to know if my executable is run in foreground like this $./a.out or like this $./a.out & ...
How do we create multiple thread during runtime in C programming language? If we need to create same amount of thread as specified by the user how do we do it? ...
On a typical OS how many files can i have opened at once using standard C disc IO? I tried to read some constant that should tell it, but on Windows XP 32 bit that was a measly 20 or something. It seemed to work fine with over 30 though, but i haven't tested it extensively. I need about 400 files opened at once at max, so if most moder...
i want to know how and when can i use exit() function..like i had a programme written in book.. #include<stdio.h> void main() { int goals; printf("enter number of goals scored"); scanf("%d",&goals); if(goals<=5) goto sos; else { printf("hehe"); exit( ); } sos: printf("to err ...
Possible Duplicate: Does free(ptr) where ptr is NULL corrupt memory? Why do I keep seeing this code? Actually I personally wrote this type of code, and I must say that I'm not sure why either :-D Maybe I just saw it somewhere. Is there any platform that actually fails on free(0);? ...