simeesta's Profile User Rating: *****

Reputation: 195 Stalwart
Group:
Active Members
Active Posts:
544 (0.39 per day)
Joined:
04-August 09
Profile Views:
11,480
Last Active:
User is offline May 05 2013 10:23 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
AMD
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   simeesta is wondering what his status is.

Posts I've Made

  1. In Topic: Program stops working after this integer input

    Posted 19 Feb 2013

    The newline is being read, instead of your character. To remove it from the input stream you could use
    getchar();
    
  2. In Topic: Using a loop to convert hex to binary?

    Posted 19 Feb 2013

    Here's a version that uses a similar method to your first post:

    #include <stdio.h>
    
    void toBin(int v); 
    int main()
    {
      char string[] = "0xCCCDB";
      int val;
      //convert string to an int
      sscanf(string, "%x", &val);
      toBin(val);
    
      return 0;
    }
    
    void toBin(int v)
    {
      int arr[31];
      int i;
      for (i=0; i <31 && v != 0; i++)
      {
        arr[i] = v%2;
        v = v/2;
      }
      i--;
      while(i>=0)
      {
        printf("%d",arr[i]);
        i--;
      }
    }
    
    
  3. In Topic: Quick question: Initializing pointer vector

    Posted 18 Feb 2013

    Well m_pMap is a pointer to a vector. You should be able to do
    m_pMap = new vector<title>[MAP_WIDTH];
    

    This creates MAP_WIDTH vectors. And you can do stuff like
    m_pMap[i].push_back(my_Tile);
    
    If you just want one vector try
    m_pMap = new vector<title>;
    


    At the moment you're trying to create a two dimensional array of vectors.

    If you want a 2d array of vectors then you'll probably need a loop to initialise them, and the type will be
    vector<tile> **m_pMap;
    
  4. In Topic: DIY sprintf

    Posted 2 Aug 2012

    Here'e my version. It took look me longer than it should have though. Lots of fun!
    Spoiler
  5. In Topic: Substring check

    Posted 27 Jul 2012

    What about:
     substring("adam","adadam");
    

    Does this work?

My Information

Member Title:
Deadly Ninja
Age:
21 years old
Birthday:
September 29, 1991
Gender:
Location:
London
Interests:
Computers, Maths, Karate, Films, Games.
Full Name:
Simon
Years Programming:
2
Programming Languages:
C/C++, Haskell, Java, X86/X86-64 assembler, prolog, MATLAB.

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://
Facebook:
http://www.facebook.com/sapensadler

Comments

Page 1 of 1
  1. Photo

    David W Icon

    07 Jun 2012 - 01:52
    Whow ... you may like to see/use some of the C help files like
    readLine.h
    Cvec.h
    Clist.h
    and their help function files
    at ...
    http://developers-heaven.net/forum/index.php/topic,2580.0.html
    and ...
    http://developers-heaven.net/forum/index.php/topic,2582.0.html
Page 1 of 1