User Profile

Collapse

Profile Sidebar

Collapse
aeo3
aeo3
Last Activity: Feb 24 '08, 10:06 PM
Joined: Jul 19 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aeo3
    replied to How to pass two dimensional array in Java
    in Java
    That's right. It works now. Thanks
    See more | Go to post

    Leave a comment:


  • aeo3
    started a topic How to pass two dimensional array in Java
    in Java

    How to pass two dimensional array in Java

    Hi all,
    I am trying to pass a two dimensional in java but there a problem in this function
    Code:
        public static void doOutput(String args[], double vector[][40])
    Please what is the problem in this line
    See more | Go to post

  • aeo3
    started a topic conditional jump or move depends on uninitialised value(s)
    in C

    conditional jump or move depends on uninitialised value(s)

    I am using valgrind leak memory to check my program this message appears a lot of time, the program works but why this message.
    example code
    Code:
    double RandNum,pp;  
        double axis=AXIS;
        double wise_profit=0.20;
        double mu, delta,a,b;
        double sattisfic_price;
      RandNum=Rand.getRandomFloat();
           
        if(prod_size<=prod_sold && prod_sold>0) SetPrice(GetPrice()+axis*RandNum);
    ...
    See more | Go to post

  • aeo3
    replied to Free Memory
    in C
    What I am talking about, I reserved a space for the array x and another space for each x[i], but in x[i] there is a space for 4 floats, What I am worried about is that space for 4 floats, In my opinion I didnot free memory for this space.
    See more | Go to post

    Leave a comment:


  • aeo3
    started a topic Free Memory
    in C

    Free Memory

    Hi All,
    I have a simple question. about free memery, I feel this is one of many reasons that make the memory crashing.
    if we have the following array

    Code:
     
    x=new float*[n];
    if(x=NULL)
    {
    exit(1);
    }
    for(int i=0;i<n;i++)
    {
       x[i]=new float[4];
      if(x[i]=NULL)
       {
          exit(1);
        }
     x[i][0]=0;
    x[i][1]=0;
    ...
    See more | Go to post

  • aeo3
    replied to Copy Array of class pointer to another
    in C
    Thanks for your explanation. I think, I did not give a good vision of my problem.
    I can explain my problem as follows:

    I create one array of Firms (ArrayFirm). And each object (ArrayFirm[i]) has an array of float. After, finishing the first round, my objects (ArrayFirm[i]) I do not need anymore and I would like to delete them, in the maintime, new object i would like to add, some will exit and others will entry, the problem...
    See more | Go to post

    Leave a comment:


  • aeo3
    started a topic Copy Array of class pointer to another
    in C

    Copy Array of class pointer to another

    Hi All,
    Now, I am trying to build a project, I need to expand an array of pointer to classes. Moreover, this array includes some elements I want to delete them. So, I create another array, copy the elements which i want to keep and copy this array to the original one as follows
    Code:
     This function to create two arrays it depends on the parameter x.
    
    void Econ::CreateFirms(int array,int x) 
    {
    if(x==1)
    ...
    See more | Go to post

  • aeo3
    replied to Cannot access memory at address 0x4c6d000
    in C
    It is too complicated structure, But I can summarized as follows
    first, I created a pointer to class sys
    second, In the constructor of that class I created a pointer to array of another class E
    third, In the constructor of each one of two I created three pointers, 1-for an array of class f, 2-is an array of class h and a pointer to a class G
    when I am dealing with second, I choose the neighbour for the current E up and...
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Cannot access memory at address 0x4c6d000
    in C
    When I am using a different operating system and different complier the error is stack error
    See more | Go to post

    Leave a comment:


  • aeo3
    started a topic Cannot access memory at address 0x4c6d000
    in C

    Cannot access memory at address 0x4c6d000

    Hi All,
    I have a problem when I am trying to implement my program, This problem is "Cannot access memory at address 0x4c6d000".
    What I did is as follows:
    1- Create a pointer to array of classes
    2- call a function from one of these class that it returns pointer
    Thank you for your help
    See more | Go to post

  • aeo3
    replied to Append a number to set of characters
    in C
    This is the new trial that i am trying to use string but there is many problems so I thought to use char
    [code=cpp]
    string int2string(cons t int& number)
    {
    ostringstream oss;
    oss << number;
    return oss.str();
    }



    string FILENAME;

    for(int i=0;i<numEco;i+ +)
    {
    FILENAME="inf_h _";
    FILENAME+=int2s tring(h);...
    See more | Go to post
    Last edited by sicarie; Sep 13 '07, 01:13 PM. Reason: Code tags

    Leave a comment:


  • aeo3
    replied to Append a number to set of characters
    in C
    I was tried to use itoa, but compiler complains, Also, i am using c++ with Cgywin complier...
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Append a number to set of characters
    in C
    With string we can use a function strcpy, but with character variable it is not available to do this
    I mean, I would like to change my filename within a loop
    filename1.txt
    filname2.txt ...etc...
    See more | Go to post

    Leave a comment:


  • aeo3
    started a topic Append a number to set of characters
    in C

    Append a number to set of characters

    Hello Everybody;
    I would like to append a number to set of char, I do not like to use string, because In my project I am using several files.
    What I did but there is a problem with it is as follows
    1. char filename[30];
    2. int x=2;
    3. filename="xxxxx ";

    But i do not know how to append 2 to filename.
    Thanks
    See more | Go to post

  • aeo3
    replied to Define a string
    in C
    it is zero. And I did not open my account for more than 12 hours
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Define a string
    in C
    to sicarie

    what is the problem, you send me a message, i do not know the reasons to tell me something like that why? what happen?
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Define a string
    in C
    I think it is good idea, thanks a lot.
    The only way that I found to use ostringstream is by adding std::ostringstr eam also, when I'm trying to define a string variable;
    string var;
    it is not accepted as a variable type
    So, array of char is the alternative way to deal with it. But what is c.str()?.
    The idea that i need to do, my program will generate a series of output files, and i need to distinguh between these...
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Define a string
    in C
    char filename[25];
    std::ostringstr eam oss;
    oss<<"inf_h_"<< x<<"_f_"<<y<<". txt";
    filename=oss.st r();
    this is a part of my code,
    the error message is : incompatible types in assigment of 'std::basic_str ing(char,std::c har_traits<char >, std::allocator< char>>' to char[25]
    also, i tried to use pointer to char, but error messages appears.
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Define a string
    in C
    Thanks it works, but i need to put this string in another variable, for instance
    char filename[25];
    filename=oss.st r();
    but the error message appears which is incompatible types in assigment of 'st::basic_stri ng<char,.....
    See more | Go to post

    Leave a comment:


  • aeo3
    replied to Define a string
    in C
    When I am trying to use ostringstream oss;
    undecalare ostringstream
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...