Many large programs are programmed in plain C !
Type: Posts; User: ddutch
Many large programs are programmed in plain C !
Defenitily YES!
Your: for( int i = 0 ; i == MAXIM ; i++ )
Better could be:
for( int i = 0 ; i < MAXIM ; i++ )
You wrote: "I have 8 bit string and I want...."
Just for the record; your "unsigned char buffer[8]" is an array of 8 bytes and it is not 0-terminated so it is not a C-string...
oeps, the for statement should count until x < 172 since one byte is needed for the 0 character
It should work but it looks a bit funny to initialize x with -1 and increase x as long as it is smaller than 171
and indeed don't forget the terminating 0
I think the code looks better if you...
#include <stdio.h>
int main()
{
unsigned char aByte = 1; // == 00000001
unsigned char myInput = 126; // just some random value which fits inside a byte (unsigned char)
unsigned...
what about:
temp->next = malloc(..);
temp = temp->next;
----
....
temp->next = NULL;
In C, global variables, like myItem are initialized to 0 or NULL by the compiler !
Item_Array my_array is not a global variable and thus not initialized, only during run-time you assign values of...
Your code above will cause runtime problems (segmentation fault) because the pointers iptr and fptr probably do not point to allocated memory
so you cant assign a value to be contained by that...
I once wrote a web-server (which is a long story) and used epoll. One of the functions I used was epoll_ctl(). Through this function one can determine for example that the client is no longer...
In your very first example you try to copy a string into an integer ....
In your other code snippets, you let a char- pointer point to an already existing array (of chars), that works.
But in your...
Don't want to patronize but your functions must have and return a certain data-type. Or void if they return nothing.
Like
int main()
{
---------
return(some_integer_value);
}
FYI, the sizeof() a struct foo shows you the size of an unsigned int ( which on my system is 4 (bytes)).
Through the Tiobe Index you might get an idea of their definition of what is a programming language and also of what are the most used/popular programming languages.
See:
Programming Languages...
The header-file ctype.h shows a whole lot of character handling functions.
Or have a look here: The GNU C Library
Use proper indentation....
Start with including the appropriate header-files
you might like the C-library function strstr()
sorry christop, while I was typing you already sent an answer
You can use a pointer to a function and also pass the parameter(s) which go with that function.
It does not look nice/readable but it can be done.
For example:
#include <stdio.h>
void...
The code above is just a general idea, the rest you have to work out by yourself
You can put the display of the main menu inside a while-loop which only stops if the user chooses option 3. Also then dsplyPswd() should return 3 and its value should be assigned to the variable...
First of all, this is not correct.
You forgot the space required for the 0-character at the end of yesno
It is also a good habit to NOT use global variables when you not realy need to., keep...
You can convert date A into a time_t value (seconds passed since 00:00:00 on January 1, 1970) and do the same with date B. Next use difftime()
In order to convert a certain date into an above...
Thanks for your comments, it can be good for portability to be somewhat "pedantic"
Using the GNU Compiler Collection (GCC): C Dialect Options