Search Result

Collapse
26 results in 0.0032 seconds.
Keywords
Members
Tags
pointer
  •  

  • hinomotoblade
    started a topic Type Cast Pointer, Child and Parent Interaction
    in C

    Type Cast Pointer, Child and Parent Interaction

    Hello there, until now i am still confused about this one, i mean what for we cast the child class to parent class?.. since child class can access all of the member of the parent class, yeah since its has public modifier..

    And also, we can cast the parent as a child using dynamic_cast right?.. but what for?..

    I still relly confused about pointer interaction, why we need access the pointer thingy..

    Thx...
    See more | Go to post

  • Gregosky
    started a topic convert double* to float*
    in C

    convert double* to float*

    Hi guys,

    I have written a library that manipulates data stored in double arrays. It took months to fine tune it and here it is, working fine. Everything was great until I started integrating my project with another open source project that uses float arrays. I need to pass my double arrays to the function that requires float arrays.. I am out of ideas how to do that.. I would like to avoid re-writing my project to use float instead...
    See more | Go to post

  • Pointer gets lost when calling one construction from another

    A constructor to a class takes some arguments including a pointer which is assigned to a class variable. The constructor then calls a default constructor, but inside the default constructor the pointer is no longer valid.

    some code should illustrate.

    Code:
    Feature::Feature(){
        cout<<"at b "<<oc<<endl;
        cout<<"b is "<<oc->geoSphere->getNumVs()<<endl;
    ...
    See more | Go to post

  • Why do i have to assign this iterator pointer to a variable before i can use it?

    im using g++ on ubuntu 10.10

    i have a pointer to a vector of pointers to objects and i want to call a method on each of those objects.
    oc->features is defined as:

    vector<Feature* >* features;

    i have to do:

    Code:
    vector<Feature*>::iterator it;
        for (it=oc->features->begin();it!=oc->features->end();it++){
            
            Feature* a=*(it);
    ...
    See more | Go to post
    Last edited by Niheel; Feb 9 '11, 05:08 PM.

  • How to return arrays from function using pointer_segmentation fault?

    Code:
    #include<stdio.h>
    #include<stdlib.h>
    int **array();
     main()
    {
      int **result=array(),i,j;
    
    
    
      //display result
    for(i=0;i<2;i++)
      printf("\n");
    	  for(j=0;j<2;j++)
    	    printf("%d \t",result[i][j]);
    
    }
    
    
    
    
    //function
    int **array()
    {
    ...
    See more | Go to post

  • AlarV
    started a topic Java GUI Static component, NullPointerException
    in Java

    Java GUI Static component, NullPointerException

    Hey everyone, I created a GUI project, where I'm using a JTree. When it's created everything is ok, but in my run() method when I call it i get a nullPointerExce ption. Here is the code.
    Code:
    treePanel = new javax.swing.JPanel();
    DefaultMutableTreeNode top =
            new DefaultMutableTreeNode("blah");
            mytree = new javax.swing.JTree(top);
    javax.swing.GroupLayout treePanelLayout = new javax.swing.GroupLayout(treePanel);
    ...
    See more | Go to post
    Last edited by AlarV; Jan 7 '11, 10:11 AM. Reason: additional code

  • Shane Fitz
    started a topic How to fix errors relating to pointers in C?
    in C

    How to fix errors relating to pointers in C?

    I am getting a warning and a common error in my code, and I need help understanding them.

    The warning is:[Warning] assignment makes pointer from integer without a cast

    Here is the code that i get the warning from:
    Code:
    line1 = biset_new(MAX_STRING); 
    	line2 = bitset_new(MAX_STRING);
    	bitset_un = bitset_new(MAX_STRING);
    	bitset_in = bitset_new(MAX_STRING);
    the left hand of...
    See more | Go to post

  • Converting C# Byte Pointer into VB.NET

    I'm currently coding a for fun version of a texture transfer tool from a paper i read from SIGGRAPH'01..i' ve figured out most of the coding based on the C# i found somewhere but I'm having trouble with its conversion into VB.NET.

    my line

    Code:
    Dim ptr As Pointer(As Byte) = CType(CType(bmpData.Scan0, Pointer(Of System.Void)), Pointer(Of Byte))
    returns an error that says Pointer is not defined (BC30002)....
    See more | Go to post

  • Jose Diaz
    started a topic Converting VOID* to INT ON C/C++

    Converting VOID* to INT ON C/C++

    In the past couple of days i have noticed that a lot of people are having problems casting from one data type to another specially from void to char or int.

    First of all void* just means that the variable can pretty much hold any type of data, from character all the way unto float. Let me just show you >>

    Lets say you want void *variable;
    to be equal 100;

    Code:
    void *variable = 100;
    Now...
    See more | Go to post
    Last edited by NeoPa; Nov 18 '10, 11:48 PM. Reason: Removed illegal email and added CODE tags.

  • szidijani
    started a topic operator[] does not work
    in C

    operator[] does not work

    Hello!

    I have a homework for tomorrow, and I simply can't solve it.
    I have a list (with template) class, I wrote and it has an operator:

    Code:
    T& operator[](int i)
        {
            ToFirst();
            for(int j=0;j<i;j++)
            {
                StepForward();
            }
            return Act->value;
        }
    For using the elements with indexes.
    And I've...
    See more | Go to post
    Last edited by Markus; Nov 16 '10, 01:00 PM. Reason: Added [code] tags, undeleted thread and moved it to /c/answers/

  • Is ((char **) &var_name); a cast to char array giving existing pointer to var_name?

    I am currently reading/learning c. I often like to look at code while I read, - to see more practical use then often are feasible in educational books.

    I am looking at some code from wget.

    Code extracted from wget.
    Code:
    /* file: mswindows.c */
    void
    windows_main (char **exec_name)
    {
      char *p;
    
      /* Remove .EXE from filename if it has one.  */
      *exec_name = xstrdup
    ...
    See more | Go to post
    Last edited by Rizladonovich; Sep 19 '10, 04:30 AM. Reason: added code for xstrdup, changed title

  • Why is the gap between an address of a file pointer, to the one after it, is only 32

    #include<stdio. h>
    char garb;
    FILE *f ,*g;

    int main(){
    f=fopen("try1.t xt","wt");
    g=fopen("try2.t xt","wt");

    printf("f is equal to %ld\n",f);
    //the result is 2009464032

    printf("g is equal to %ld\n",g);
    //the result is 2009464064

    //I...
    See more | Go to post

  • livesinabox
    started a topic Trouble understanding "Double" Pointers.
    in C

    Trouble understanding "Double" Pointers.

    I am a student and I am having trouble understanding Dynamic Memory Allocation and the usage of Double Pointers.

    Code:
    int **A
    
    A=(int **)malloc(r1*(sizeof(int*)));
    
    for(i=0;i<r1;i++)
    A[i]=(int *)malloc(sizeof(int)*c1)
    In the above snippet r1 and c1 refer to the number of rows and columns of a matrix A.

    My question : What does the malloc function do here? I know malloc()...
    See more | Go to post
    Last edited by Banfa; May 28 '10, 09:20 AM. Reason: Use this slash / for closing tags :-)

  • miner
    started a topic Passing a pointer to a function ... how?
    in C

    Passing a pointer to a function ... how?

    Hi all

    I'm doing my first steps in C and I need some help plz.

    I have 2 structs, a node* and a stack*. I want to write a push() function that accepts to arguments, the node to insert and the pointer to the the top of the stack.

    This way it works without problems: push(node *theNode, stack *theStack)
    The call looks like that: push(newNode, newStack) and inside the function I can access the pointer...
    See more | Go to post

  • rorybr
    started a topic import unmanaged dll into c sharp

    import unmanaged dll into c sharp

    hi,
    i'm trying to import an unmanaged dll into a c# application. The dll is given to me but i'm new with dll import thing and having some troubles importing it. Dll comes with a pdf file which describes the functions but all parameters and types are c++ type and i need to write them as c# types. i tried "Dllimport" but i think i couldn't write the correct parameter types. Functions use handles and pointers which doesn't make it easier...
    See more | Go to post
    Last edited by tlhintoq; Apr 25 '10, 04:41 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]
Working...