Search Results

Search found 3592 results on 144 pages for 'pointer'.

Page 74/144 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • Problem getting size of Website Xcode

    - by Michael Amici
    When i try and compile I come up with a warning that reads initialization makes pointer from integer without a cast. No clue why. I am just trying to get the size of a website. #import "Lockerz_RedemptionViewController.h" @implementation Lockerz_RedemptionViewController -(IBAction)startLoop:(id) sender { NSData *dataNew = [NSData dataWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com/"]]]; NSUInteger *len = [dataNew length]; //error is here NSLog(@"%@", len); }

    Read the article

  • How do you return a string from a function correctly in Dynamic C?

    - by aquanar
    I have a program I am trying to debug, but Dynamic C apparently treats strings differently than normal C does (well, character arrays, anyway). I have a function that I made to make an 8 character long (well, 10 to include the \0 ) string of 0s and 1s to show me the contents of an 8-bit char variable. (IE, I give it the number 13, it returns the string "0001101\0" ) When I use the code below, it prints out !{happy face] 6 times (well, the second one is the happy face alone for some reason), each return comes back as 0xDEAE or "!\x02. I thought it would dereference it and return the appropriate string, but it appears to just be sending the pointer and attempting to parse it. This may seem silly, but my experience was actually in C++ and Java, so going back to C brings up a few issues that were dealt with in later programming languages that I'm not entirely sure how to deal with (like the lack of string variables). How could I fix this code, or how would be a better way to do what I am trying to do (I thought maybe sending in a pointer to a character array and working on it from the function might work, but I thought I should ask to see if maybe I'm just trying to reinvent the wheel). Currently I have it set up like this: this is an excerpt from the main() display[0] = '\0'; for(i=0;i<6;i++) { sprintf(s, "%s ", *char_to_bits(buffer[i])); strcat(display, s); } DispStr(8,5, display); and this is the offending function: char *char_to_bits(char x) { char bits[16]; strcpy(bits,"00000000\0"); if (x & 0x01) bits[7]='1'; if (x & 0x02) bits[6]='1'; if (x & 0x04) bits[5]='1'; if (x & 0x08) bits[4]='1'; if (x & 0x10) bits[3]='1'; if (x & 0x20) bits[2]='1'; if (x & 0x40) bits[1]='1'; if (x & 0x80) bits[0]='1'; return bits; } and just for the sake of completion, the other function is used to output to the stdio window at a specific location: void DispStr(int x, int y, char *s) { x += 0x20; y += 0x20; printf ("\x1B=%c%c%s", x, y, s); }

    Read the article

  • c++, when do you need/have to pass data as (*&)

    - by ra170
    I came across people passing data objects as: declaration: DataObject * data = 0; calling it as: SomeMethod( data ); definition of Somethod: void SomeMethod(SomeObject * & object) My obvious question is, when and why do you have to do this (& *)? Is it passing the pointer as reference?

    Read the article

  • [C++ / NCURSES] Can't convert from 'int' to 'int *'

    - by flarn2006
    So I have these lines of code: int maxY, maxX; getmaxyx(stdscr, &maxY, &maxX); It gives me the following error: error C2440: '=' : cannot convert from 'int' to 'int *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast twice for each time I use it. I'm not even using the = operator! The curses.h file is included. What am I doing wrong?

    Read the article

  • unix DECLARE_WAIT_QUEUE_HEAD (var) var prototype?

    - by yoavstr
    hello i want to work with 2 queue in the module where i change my pointer to them therefore i need to use : //declartion wait_queue_head_t **currentQ; DECLARE_WAIT_QUEUE_HEAD (readWaitQ1); DECLARE_WAIT_QUEUE_HEAD (readWaitQ2); if(condition){ currentQ = &readWaitQ1; }else{ currentQ = &readWaitQ2; } but i get incorrect type for wake_up an other stuff using the queue. even thought i google it i couldnt find an answer can someone just give me the prototype needed?...

    Read the article

  • C++ Pass a hidden arg to a class constructor?

    - by JP
    I would like to define a class that accept the pointer to it's parent class as an Argument, but would it be possible to somehow pass it without needing to pass it directly such as: class Child { public: Child(Parent* hiddenArg); }; class Parent { public: Child myChild; }; I know this is weird, but I am making my own Signal/Slot implementation and Child would be a signal defined, but I would like to get the parent so I can use it's Event Dispatcher...

    Read the article

  • problems with 'free' in C

    - by lego69
    hello, can somebody please explain can I free const char* ? I allocated new memory using malloc and when I'm trying to free it I always receive an error incompatible pointer type thanks in advance something like this char* name="Arnold"; const char* str=malloc(stlen(name)+1); free(str); <- here bug

    Read the article

  • Sample code for POST + cookie?

    - by OverTheRainbow
    Hello, I've been googling for some VB.Net code to authenticate to a web server with the POST method, receive a session ID in a cookie, and then send this cookie along with all GET queries... but all I found is half-working code or C# code, ie. difficult to use for a VB.Net newbie. Would someone have some code handy or some pointer that I could use to get started? Thank you.

    Read the article

  • WinCheat / WinSpy-like tool for C++ Builder exes

    - by mawg
    I just came back to C++ Builder after 5 or more years away. I seem to remember a nice tool where I could drag its pointer over the GUI of my running application and get lots of info about what was pointed at - handle, size, text, parent, children, etc IIRC, if the exe include debug info I could also get the actual variable name as used in the source. Does anyone know what program I am talking about? Thanks

    Read the article

  • merging indexed array in Python

    - by leon
    Suppose that I have two numpy arrays of the form x = [[1,2] [2,4] [3,6] [4,NaN] [5,10]] y = [[0,-5] [1,0] [2,5] [5,20] [6,25]] is there an efficient way to merge them such that I have xmy = [[0, NaN, -5 ] [1, 2, 0 ] [2, 4, 5 ] [3, 6, NaN] [4, NaN, NaN] [5, 10, 20 ] [6, NaN, 25 ] I can implement a simple function using search to find the index but this is not elegant and potentially inefficient for a lot of arrays and large dimensions. Any pointer is appreciated.

    Read the article

  • how to access char*** from dll import in C#

    - by mavrick
    I have a function in win32 dll with signature as: void func1(int a, char*** outData) int a -- input parameter char*** outData -- output parameter - pointer to array of char strings Any idea how to access this in C# using dll import & what should be the signature.

    Read the article

  • Including a C header which declares a variable called "new"?

    - by StackedCrooked
    I'm trying to use the OpenCA library in a C++ application. However, when including the file pki_x509_data_st.h the following code fragment is encountered: typedef struct pki_x509_callbacks_st { /* ---------------- Memory Management -------------------- */ void * (*new) (void ); void (*free) (void *x ); void * (*dup) (void *x ); This won't compile because of the "new" pointer declaration. How can I make it work?

    Read the article

  • C++ variable alias - what's that exactly, and why is it better to turn if off?

    - by Poni
    I've read the essay Surviving the Release Version. Under the "Aliasing bugs" clause it says: You can get tighter code if you tell the compiler that it can assume no aliasing.... I've also read Aliasing (computing). What exactly is a variable alias? I understand it means using a pointer to a variable is an alias, but, how/why does it affect badly, or in other words - why telling the compiler that it can assume no aliasing would get me a "tighter code"

    Read the article

  • Why can't I make my parameter like this?

    - by mystify
    - (void)setPropertyValue:(const *void)inValue forID:(UInt32)propertyID { } The compiler doesn't like the const *void, for some reason. When I have that, it says: error: expected ')' before 'void' When I make the parameter like (UInt32)foo there is no problem. Does const *void only work in functions? I need a parameter which can be a "pointer to anything" like UInt32, Float64, etc.

    Read the article

  • Linux signals with extra information parameter

    - by Tester
    I was to have some extra information in the callback to sa_sigaction handler, it does not seems possible. So I was wondering if you could suggest me alternatives. Basic requirements: Function A raises an signal/event with a pointer to a struct Handler function tackles the event. The handler function would only be called on an event and a loop to wait for the event, as in select() , is undesirable. TIA

    Read the article

  • managing IB objects without iboutlets

    - by palominoz
    i have got 24 buttons in my project.I need to manage them but I don't want to get my MainViewController polluted by 24 declarations of pointers, properties & synthesizes. i was thinking about using buttonPushed functions and do it like: -(IBAction)buttonPushed:(id)sender{ UIbutton *button=sender; [buttons addObjectAtIndex:[sender tag]]; } my question is:is sender a pointer to the IBObject?

    Read the article

  • How to set css to "label for="email""

    - by Kyle Sevenoaks
    Code: <label for="email">{t _your_email}:</label> CSS: label { display: block; width: 156px; cursor: pointer; padding-right: 6px; padding-bottom: 1px; } I want to make a new CSS for the email label as it's not meant to be that wide.. Just can't think right now :P Thanks.

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >