say i have an array of chars
char temp[];
strcpy(temp,"$100,000.00");
now i want to just take out all the non numeric values such as $ , and .
the string in temp is not always going to...
hi,
if we make parameters as const, user cannot modify it. but would it be more overhead for system?thanks
hello. i have the following code.
if realloc acts as malloc, return value of r = new pointer to a memory location. ptr will be NULL.
if realloc changes the location of the memory for a ...
hello, what is the correct wat to pass in a array of strings to another function?
char *collection[];
void somefunction() {
generate_code(collection);
}
void generate_code(char* c[]) {
...
I would appreciate any help on trying to compare two strings in my program. In this wof program when the player tries to solve the puzzle it shouldn't matter if he should have to enter charac...
Hi, im trying to do something and assign the values to a pointer to a string. the following is my code.. the current code is not efficient.. any one can help me improve on this? what im trying...
Hi,
Hopefully this has an easy solution, though browsing the web has not given me any quick and simple answer.
I'm developing a microcontroller project that will have an embedded web ser...
hi,
i have an array like this:
char **array which i want to store like this
cat
dog
rat
an array of pointers...
array=calloc(10,sizeof(char*));
then, i have a loop....
fo...
In some C code I want to use the system() command to start another C program with no connections to the origoinal C program. As I understand it the system() call will not return until the "oth...
Why does the following result in heap corruption
char* tempString = new char(strLen+1)
for( i = 0; i < strLen; i++)
{
*(tempString+1) = 'A';
}
tempString[srcLen] = NULL;
delet...
hi, i have the following code. the while loop will be looping infinite times. i can resolve this by putting curr = NULL; but is it efficient?
I have to write a program in C that reads data from a table and writes to an Excel file. I am originally a Java programmer and I have never written code in C except in college. A sample code w...
hi, im build a tracing application to track memory calls. To do this, im creating a lib ìnterpöser to intercept the functions and record the data accordingly into a text file with following fo...
can anyone here help me to find an implementation of a tries in C? if possible the .h and .c file..
the tries is to store words in a dictionary and it needs to be able to have a insert fun...
I was wondering if someone could help me figure out this problem. I need to parse a sentence into words and print out each word in the sentence along with its length. Currently this is what ...
Hi experts,
I have a large project containing about a 100 source and header files, written by other people. It is written in C on Linux. I am working on Windows and compile it with gcc and ...
Referring to my previous Q: http://www.experts-exchange.com/Programming/Languages/C/Q_23505779.html?cid=239#a21894284
I'd like to ask you if there is a possibility to change my actual code ...
hi,
to use getc from file, it is like this
c=getc(f) where f is the filepointer...
my problem is that i want to atoi the value read ....
for example if the value is read 2, i want ...
1.) Here is my program, the error message follows. Supposedly the % is for modulus and is supposed to give me a remainder?
2.) If I did a scanf, and entered any interger or float value, how w...
I have a code which is as follows
typedef struct {
int offset
int handle
}objectptr;
typedef objectptr far *objptr;
I would like to know purpose of far keyword here?
I...
I am trying to get the last set of string, in my code, "out_file" from a given string. I am using strtok() function, but getting compile error at the line "char* result = strtok(str, "/");" ...
please explain the difference between above terms. and which feature of these does C/C++ have.
Thanks.
I have the code below:
#include <stdio.h>
#include <stdlib.h>
int didThisHit (int HitRolls, int ResistRolls);
void main()
{
int total = 0;
int meta_counter= 0;
...
hi,
i have like this:
if( value1 > value2)
maximum=value1;
else
maximum=value2;
there are many ways of doing this where way 1 is like above.
second way:
if( value1 > value2)
...
How could one more easily transform a (huge) C program that uses the 'curses' library for keyboard and screen management into a GUI program without changing the program itself but just the cal...