Search:

Type: Posts; User: cable

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Thread: 2-3 tree

    by cable
    Replies
    2
    Views
    821

    if i know what numbers i want to put in the tree...

    if i know what numbers i want to put in the tree what should i think for succeeding my goal? or i have to randomly try combinations?
  2. Thread: 2-3 tree

    by cable
    Replies
    2
    Views
    821

    2-3 tree

    lets say i have some int values
    for example 1;2;4;7;8
    which one is the best way to determine in what order should i insert the int numbers in the 2-3 tree for having the fewer possible nodes
  3. Replies
    1
    Views
    843

    tree maximum level

    int Depth(NODE *base)
    {
    if (base==NULL) {
    return(0);
    }
    else {
    int ltree = Depth(base->left);
    int rtree= Depth(base->right);
    if (ltree > rtree) return(ltree+1);
    else...
  4. Thread: char pointer

    by cable
    Replies
    5
    Views
    959

    so if i still want to keep the pointer of string...

    so if i still want to keep the pointer of string how can i solve the problem
    i mean with minimum changes
  5. Thread: char pointer

    by cable
    Replies
    5
    Views
    959

    fopen is succeed even if i put fclose still the...

    fopen is succeed even if i put fclose still the same problem
    also c is a pointer of string so like i know it can still point to string even if i do not malloc
  6. Thread: char pointer

    by cable
    Replies
    5
    Views
    959

    char pointer

    #include <stdio.h>
    #include <stdlib.h>

    int getsize(void){
    int counter=0;
    FILE *testa;
    testa=fopen("error.txt","r");
    char *c;
    while(fscanf(testa,"%s",c)!=EOF) counter++;
    printf("%s",c);
  7. Replies
    4
    Views
    1,029

    thanks for the replies but i still have not find...

    thanks for the replies but i still have not find how to solve this problem
    any other please?
  8. Replies
    4
    Views
    1,029

    fscanf from txt file

    hello i have to make one program which fscanf info from a txt file
    each line has this type of info which i have to save the 3 int numbers


    3=3,3
    so i get the numbers with this example...
  9. Replies
    4
    Views
    1,343

    thanks for the reply i have written the function...

    thanks for the reply
    i have written the function which always saves the current numbers which are not the same but i cannot find how can i save the first numbers which are not the same as the...
  10. Replies
    4
    Views
    1,343

    read 2 numbers each and compare them

    lets say you keep reading two int numbers every round
    you save the first int numbers which they are not same and the last two numbers which they are not
    so if you read this
    2, 3
    4,5
    5,6
    7,7...
  11. Replies
    3
    Views
    1,564

    compare two strings

    whats the best way for comparing 2 string to check if they are equal
    i know that 1 ways is with strcmp(string1,string2) but i want to compare them, first with upper and lower letters make them...
  12. Thread: fscanf 2 string

    by cable
    Replies
    2
    Views
    998

    fscanf 2 string

    hello i have two strings in each line always the second is number ,and first is a word (both of them in a file)
    for example

    tri 123
    t 352
    vf 333

    the important is that spaces have not always...
  13. Replies
    2
    Views
    1,460

    declare functions with a variable's size

    hello i have this function

    void learn_size(int *size,char *point)
    which finds the *size from a txt file
    then im declaring a function like this

    void read(int xarray[*size][*size])
    as im not...
  14. Thread: Craps - stuck

    by cable
    Replies
    6
    Views
    1,763

    compile this and tell me if its correct what i...

    compile this and tell me if its correct
    what i changed is listed at my previous post

    #include <iostream>
    #include <cstdlib>
    #include <ctime>
    #include <time.h>
    #include <iomanip>

    using...
  15. Thread: Craps - stuck

    by cable
    Replies
    6
    Views
    1,763

    what error appears , compile error or logical ...

    what error appears , compile error or logical
    i have compiled the next code and i think it works
    if the problem does not have to do with compile then please tell us what make you think its wrong...
  16. Replies
    1
    Views
    1,217

    private variables

    what is the meaning of PRIVATE members
    i think one of their purpose is to protect us from wrongly changing them, am i right?
  17. Replies
    3
    Views
    1,490

    c++ operator overload

    what i know until now is that we can overload << >> + - ++ ..
    but i cannot understand when we declare the operator we put this & before the variable also sometimes we write 2 variables in operator...
  18. Thread: re-declaration

    by cable
    Replies
    7
    Views
    1,096

    can you please give an code example of how to not...

    can you please give an code example of how to not define the struct constructor in source file ?
    if the define its the problem can you give me an exampe of how to not define the constructor and only...
  19. Thread: re-declaration

    by cable
    Replies
    7
    Views
    1,096

    im sorry but im not allowed to change the header...

    im sorry but im not allowed to change the header file
    comes with this homework and am not allowed to change it
    is there any other way which i can do in cpp file?
  20. Thread: re-declaration

    by cable
    Replies
    7
    Views
    1,096

    sorry if i did not make a question what im...

    sorry if i did not make a question
    what im trying to do is to make a constructor in cpp file for struct node in header file
    and the error is redefinition at the line which i write the struct...
  21. Thread: re-declaration

    by cable
    Replies
    7
    Views
    1,096

    re-declaration

    header file
    struct node {
    int x;
    node *next;

    node(y, node *next)
    : x(y), next(next) {}
    };
  22. Replies
    2
    Views
    754

    linked list general question

    lets say i have a linked list with only one value at head
    if i say


    node *head=(first input)
    *pointerb=head;
    pointer->next=(new input)

    then if i say
  23. easiet way to put digits at the left side of number

    lets say i have a long type variable
    for example
    long x =43343539839853583;
    im looking for the best algorithm to put 111 for example at the left of the number(
    final result...
  24. Replies
    3
    Views
    4,328

    isdigit() not working

    #include <stdlib.h>
    #include <stdio.h>
    int main(){
    long x;
    scanf("%ld",&x);
    if(!isdigit(x))
    printf("error");
    return 0;
    }
  25. Replies
    4
    Views
    1,545

    i have write this code but "free()" seems to not working

    start_node its the node which search should be start for deleting nodes(if you don't find meaning with it, me either but i have to use it

    node_t * locate_node(list_t * l, node_t *start_node, int...
Results 1 to 25 of 66
Page 1 of 3 1 2 3