« first day (507 days earlier)      last day (1921 days later) » 

12:11 AM
(define (pow m e)
  (if (= 0 e) m (* m (pow m (- e 1)))))

(define (find-n a b)
  (define (do-find a b n)
    (if (> (pow b n) a) n (do-find a b (+ 1 n))))
  (do-find a b 0))
1 message moved from Lounge<C++>
 
 
10 hours later…
user1182183
10:24 AM
ee can anyone tell me why free() crashes on a bool but not on a cell?
Taken = (bool*)calloc(amount_of_nodes_ ,sizeof(bool));
Paths = (cell*)malloc(amount_of_nodes_ * sizeof(cell));
memcpy(Paths, Paths_, amount_of_nodes_ * sizeof(cell));
//
free(&Paths);
free(&Taken);//crash
 
user1182183
this is the struct :$
:

struct RouteData
{
cell * Paths;
bool * Taken;
int amount_of_nodes;
int id;
RouteData(cell *Paths_,int amount_of_nodes_, int id_)
{
//Taken = new bool[amount_of_nodes_];
//Taken = (bool*)malloc(amount_of_nodes_ * sizeof(bool));
Taken = (bool*)calloc(amount_of_nodes_ ,sizeof(bool));
Paths = (cell*)malloc(amount_of_nodes_ * sizeof(cell));
memcpy(Paths, Paths_, amount_of_nodes_ * sizeof(cell));
amount_of_nodes = amount_of_nodes_;
id = id_;
free(&Paths_);
}
~RouteData()
{
free(&Paths);
 
2 messages moved from Lounge<C++>
 
bob
10:53 AM
I have a problem with eclipse c++ juno. My project compiles from command line, but eclipse says it has many errors. Most includes are not resolved. Rebuilding the index didn't solve the issue. What else could I try ?
 
1 message moved from Lounge<C++>
 
 
5 hours later…
4:08 PM
switch (current_token.kind)
{
    case TOKEN_KIND_NUMBER:
    output.push_back(current_token);
    break;

    case '(':
    punctuators.push_back(current_token);
    break;

    case ')':
    remove_operators_until_parenthesis();
    break;

    default:
    determine_operator_precedence();
    process_tighter_binding_operators();
    punctuators.push_back(current_token);
}
 
sbi
1 message moved from Lounge<C++>
 
 
5 hours later…
9:19 PM
Flag this!
 
sbi
2 messages moved from Lounge<C++>
 

« first day (507 days earlier)      last day (1921 days later) »