Thanks SilentStrike!
Type: Posts; User: vangmor
Thanks SilentStrike!
We have 14 discrete symbols s1, s2, … s14. Each symbol haves the probability p1, p2, …, p14 respectively, to be transmitted. Is the average transmitted information in bits (p1*log2(1) + p2*log2(2). …...
One way is to use linked lists
typedef struct tag_linked_list_node
{
char *code; //use malloc to allocate memory for code or write char code[SMALL_SIZE]; or int code;
...
Generaly you cant. Win 32 API is different from Ansi C / C++ libraries API. Only functions which not contain any console i/o function are portable to win 32, but win 32 offers its own functions...
I couldnt read your function so i wrote my version...
#include <stdio.h>
#include <string.h>
int remove_substring(const char strToFind[], const char strToSearch[], char strModified[], char...
If you store the values as ints or floats or the correct type no...
//value = int type
*((int*)(block_pointer + sizeof(int))) = int_value;
//Next value = double...
*((double*)(block_pointer +...
There is not absolutely nothing to worry. String literals in C/C++ are always null terminated char* const. Two continius string literals concaternated in one "ABC" "DEF" -> "ABCDEF"
Maybe your...
Tip: in equality checking expretions put the value (if any) on the left.
10 == var because on error typing '==' like 10 = var -> ERROR! lvalue required.... but var = 10 is a legal assigment...
if you dont want to change int code = 0 to char code = '0' or case '1' to case 1: write:
case '1'-'0': ...
case '2'-'0': ...
...
its funny
int a, i = 5.156546;
i = 5 because i is integer.
try
int a;
double d = 5.156546;
a = (int) d;
or print
printf("%.0f\n", d);
try
if( index < strlen(str) && index >= 0) /*be sure...*/
while( str[index] != '\0' && str[index++] != '(' );
try this function
int GetFirstWord(char *line, char* firstword)
{
int i = 0, j =0;
while(line[i] <= ' ' ) /*Left trim*/
i++;