iota confusion

This is a discussion on iota confusion within the C++ Programming forums, part of the General Programming Boards category; hey there i am currently doing some assignment on prime palindromes and getting stuck on the int to string conversion.i ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    30

    Question iota confusion

    hey there

    i am currently doing some assignment on prime palindromes and getting stuck on the int to string conversion.i have been trying to google it and seems getting no where esp with iota func.

    here's the problem.


    Code:
    //the given function
    unsigned intFindPalindromes(unsigned int array[],int start,int end)
    
    //using iota
    iota (int n,char* number,10)
    
    // n is to be prime number
    //here is where i got confused.
    
    //if i do it this way ,does it mean int array[] is not the same as number[] in iota??
    // let say if n=11,how does the compiler convert int into string. 
    will it be number= [11] or number= ['1','1']???

    thanks in advance

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,181
    I am guessing you meant itoa.

    Integer TO Ascii

    Even then, this is not a standard function. Use sprintf instead. Or even better, stringstream, since you are using C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Terrible confusion with time variables
    By LowlyIntern in forum C++ Programming
    Replies: 12
    Last Post: 08-01-2008, 07:23 AM
  2. for loop confusion
    By Enges in forum C++ Programming
    Replies: 6
    Last Post: 04-26-2006, 08:21 AM
  3. Server-net newbie confusion
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 04-28-2005, 02:08 AM
  4. confusion with increment and decrement operators
    By cBegginer in forum C Programming
    Replies: 6
    Last Post: 03-19-2005, 02:45 PM
  5. Unicode - a lot of confusion...
    By Jumper in forum Windows Programming
    Replies: 11
    Last Post: 07-05-2004, 07:59 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21