Can it be passed to a function just a member of a struct so that the function changes that member?
Let's say a have a struct
struct node {
double attribute1, attribute2;
} *n;
I define an array of the above tipe,
n = (struct node *) calloc (666,(sizeof (struct node)));
The question...
Hy everyone,
first a question: I have a C file where the WinMain function resides, and where on the WM_COMMAND case I handle menu options. As an example on IDM_FILE_NEW I launch a dialog box from where I get some input which I convert to numeric variables. The dialog function I've wrote in a...
I have a dialog with an edit box written in C (à la Petzold). What I read from the edit box with GetDlgItemText function I convert to a double with an expression like:
kk = strtod(szText,&rpt);
Then I want to pass the variable kk to a MessageBox,
so I use
wsprintf(szBuffer,TEXT("Your...
Let’s say that I have a variable
char filename[12] = "xxxxxxxx.xxx";
and a function who opens a file.
void OpenFile( char *fname)
{
FILE *f;
f = fopen(fname,"w");
if( f == NULL )
{
printf( "File could not be opened\n" )...
Please can anyone help with suggestions about how to define a Boolean data type in C?
For my logical tests now I use one integer and if the condition is TRUE the integer takes value 1
and if FALSE the integer gets 0. But that's rather complicated.
If anyone has a simpler way please let me...
Hy,<br>please can anyone tell me how to write a function that returns an array. I mean when writing a function like<br><br>return_type funct_name ( arg_type arg1, ....)<br>{}<br><br>the return_type should be an array (of double maybe).
If i have a structure like :<br><br>struct node {<br> double x,y;<br> } *n;<br><br>i would like to code a routine, called from main program, who reads the two components of the structure.<br><br>void ReadStruct( ? ? ? ? ? ...
I've written a code in C that performs several computations at various time steps. I want to save the results for each time step in a file. So if anybody can help me, how to change a float type number (the time value ex. 10.25) into a string so i can strcpy it into the file name.<br>ThankYou
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.