Search:

Type: Posts; User: Structure

Page 1 of 14 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    16
    Views
    466

    This one includes integer fractions ... ...

    This one includes integer fractions ...



    int isNumber( char *string ) {
    int oneDot = 0, stringLength = strlen(string), ii;
    for (int i=0; i<stringLength; i++) {
    ii =...
  2. Replies
    16
    Views
    466

    preemptive fix... int isNumber( char...

    preemptive fix...



    int isNumber( char *string ) {
    int oneDot = 0;
    for (int i=0; i<strlen(string); i++) {
    if ( (int)string[i] >= 48 && (int)string[i] <= 57 ) {
    //...
  3. Replies
    16
    Views
    466

    int isNumber( char *string ) { int oneDot =...

    int isNumber( char *string ) {
    int oneDot = 0;
    for (int i=0; i<strlen(string); i++) {
    if ( (int)string[i] >= 48 && (int)string[i] <= 57 ) {
    // valid digit ;
    }...
  4. Replies
    16
    Views
    466

    int isNumber( char *string ) { int oneDot =...

    int isNumber( char *string ) {
    int oneDot = 0;
    for (int i=0; i<strlen(string); i++) {
    if ( (int)string[i] >= 48 && (int)string[i] <= 57 ) {
    // valid digit ;
    }...
  5. Replies
    16
    Views
    466

    #include #include int...

    #include <stdio.h>
    #include <string.h>

    int isNumber( char *string ) {
    for (int i=0; i<strlen(string); i++) {
    if ( (int)string[i] >= 48 && (int)string[i] <= 57 ) {
    //...
  6. Replies
    6
    Views
    289

    multiply the identity matrix by the scalar. ...

    multiply the identity matrix by the scalar.

    "The term scalar multiplication refers to the product of a real number and a matrix. In scalar multiplication, each entry in the matrix is multiplied by...
  7. Replies
    1
    Views
    153

    this might help... #include ...

    this might help...



    #include <stdio.h>

    void primoultimopari(char list[], int dimensione, int *prima, int *ultima) {
    *prima = -1;
    *ultima = -1;
    for (int i=0; i<dimensione;...
  8. I can understand this, but why include an entire...

    I can understand this, but why include an entire library for one function?
    Although i used strlen, i'm saying it could be useful sometimes to create the one function you need.
  9. 16198 16199

    16198

    16199
  10. considering what this code does, this is...

    considering what this code does, this is disturbing.

    16197
  11. also i believe when you do this: ...

    also i believe when you do this:

    packetBuffer[len] = 0;
    you actually want do do this:

    packetBuffer[len-1] = 0;
    also, you are going to want to zero terminate both strings.
  12. printf( "[%s]", packetBuffer ); if you don't...

    printf( "[%s]", packetBuffer );

    if you don't see [101_idle] but you see [101_idle(+ some other bs)] ;

    that could be your comparison problem.
  13. Where you commented out the comparison, print out...

    Where you commented out the comparison, print out the buffer to the console to see what it actually recieves.
  14. I'm looking at your code... go back to what...

    I'm looking at your code...

    go back to what you had i have a better idea of what you are trying to do.
  15. #include #include const...

    #include <stdio.h>
    #include <string.h>

    const char *isAvailable = "_available";
    const char *notAvailable = "_disabled";

    char tables[10][32];

    void enableTable( int table ) {
    strcpy(...
  16. ok, this is what i would do... compile this as a...

    ok, this is what i would do... compile this as a seperate program and take a look at it... give me a min.
  17. add this as a function above main() int...

    add this as a function above main()



    int compare( char *string1, char *string2 ) {

    if ( strlen(string1) != strlen(string2) ) {
    return 2;
    }
  18. it's expecting a char and you are trying to set...

    it's expecting a char and you are trying to set it to a string of chars.
    That's why i added the pointer *.


    char *situationOne = "_available";

    same for the function, change char to char *

    ...
  19. :confused:

    :confused:
  20. you could also return 2 if they are are not the...

    you could also return 2 if they are are not the same length.
    This way you can find out if you have trailing bytes at the end or beginning.



    int compare( char *string1, char *string2 ) {
    ...
  21. #include #include char...

    #include <stdio.h>
    #include <string.h>

    char *string = "string one";
    char *other = "string one";

    int compare( char *string1, char *string2 ) {
    if ( strlen(string1) != strlen(string2)...
  22. maybe try a byte to byte comparison ? i.e:...

    maybe try a byte to byte comparison ?

    i.e: instead of using strcmp(), compare:
    for (x++) { if string[x] == other[x] }
  23. Replies
    5
    Views
    350

    #include #include char...

    #include <stdio.h>
    #include <string.h>

    char *testText = "word flip function";

    void flipPrint(char *text) {
    int sLength = strlen(text);
    int this = 0, last = -1;
    for (int i = 0; i...
  24. Replies
    4
    Views
    340

    Include Syntax (The C Preprocessor)...

    Include Syntax (The C Preprocessor)

    #include "file"

    "It searches for a file named file first in the directory containing the current file"
  25. Consider the fact that people make them a lot...

    Consider the fact that people make them a lot more often than you think...
    Projects - OSDev Wiki
Results 1 to 25 of 339
Page 1 of 14 1 2 3 4