Results 1 to 11 of 11

Thread: Another probaly easy for you c++ question

  1. #1
    Senior Member crazyfool's Avatar
    Join Date
    Jan 2008
    Posts
    761
    Thanks
    77
    Thanked
    38 times in 38 posts
    • crazyfool's system
      • Motherboard:
      • Striker Extreme
      • CPU:
      • Q6600
      • Memory:
      • OCZ 6400 2 x 2GB
      • Storage:
      • Samsung Spinpoint 500GB
      • Graphics card(s):
      • BFG 8800 GT OC 512MB
      • PSU:
      • Coolermaster Real Power Pro 850w
      • Case:
      • Coolermaster CM-690
      • Operating System:
      • XP, Vista, Windows 7 & Ubuntu
      • Monitor(s):
      • Samsung 2232BW

    Another probaly easy for you c++ question

    ok i'm almost done on my coursework but one last thing i cannot get to work.
    I have a string that contains a year eg 2008 which i need to convert into an int or double... anyone plz

  2. #2
    Senior Member
    Join Date
    Jan 2008
    Location
    Q2DM1
    Posts
    259
    Thanks
    7
    Thanked
    20 times in 20 posts
    • Viper81's system
      • Motherboard:
      • Asus P8Z77-V PRO
      • CPU:
      • Intel i5 3570K
      • Memory:
      • 16Gb Corsair XMS3 1600MHz
      • Storage:
      • Many
      • Graphics card(s):
      • Asus 1Gb 6950
      • PSU:
      • Corsair 650W
      • Case:
      • Antec P182
      • Operating System:
      • Win 7 x64
      • Monitor(s):
      • 25.5" HP W2558HC
      • Internet:
      • Tin Can and String

    Re: Another probaly easy for you c++ question

    Haven't done any C++ in years but I do remember 'atoi'

  3. Received thanks from:

    crazyfool (23-10-2008)

  4. #3
    Senior Member crazyfool's Avatar
    Join Date
    Jan 2008
    Posts
    761
    Thanks
    77
    Thanked
    38 times in 38 posts
    • crazyfool's system
      • Motherboard:
      • Striker Extreme
      • CPU:
      • Q6600
      • Memory:
      • OCZ 6400 2 x 2GB
      • Storage:
      • Samsung Spinpoint 500GB
      • Graphics card(s):
      • BFG 8800 GT OC 512MB
      • PSU:
      • Coolermaster Real Power Pro 850w
      • Case:
      • Coolermaster CM-690
      • Operating System:
      • XP, Vista, Windows 7 & Ubuntu
      • Monitor(s):
      • Samsung 2232BW

    Re: Another probaly easy for you c++ question

    cheers m8 but as soon as i posted this i figured out how to do it lol... thanks anywayz... and just out of curiosity what languages do programmers today prefer to program in because after a quick google it seems people aren't really that into c++ and i was wondering if i am learning a dead languages... i was under the impression it was commonly used

  5. #4
    Senior Member
    Join Date
    Jan 2008
    Location
    Q2DM1
    Posts
    259
    Thanks
    7
    Thanked
    20 times in 20 posts
    • Viper81's system
      • Motherboard:
      • Asus P8Z77-V PRO
      • CPU:
      • Intel i5 3570K
      • Memory:
      • 16Gb Corsair XMS3 1600MHz
      • Storage:
      • Many
      • Graphics card(s):
      • Asus 1Gb 6950
      • PSU:
      • Corsair 650W
      • Case:
      • Antec P182
      • Operating System:
      • Win 7 x64
      • Monitor(s):
      • 25.5" HP W2558HC
      • Internet:
      • Tin Can and String

    Re: Another probaly easy for you c++ question

    Well as I'm not a programmer by trade I can't really comment on the language question. But what I would say is that if you're learing to write code most of your effort should really go into learning to design a program and how to structure code.
    Once you have those skills you're pretty much set. You can skip between whatever language you need to get the job done but as long as your code structure is good, actually writing the code should be the easy part.

  6. #5
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Another probaly easy for you c++ question

    Its not a dead language, but its use will dwindle more and more over the next few years.

    However, lots of people have been saying this since the dawn of Java (fools!) but here is why i think its differen't.

    Look at the i7. How many cores? If you want high performance code do you want to be messing about with the locking and intercommunication yourself.

    No, you want a language that by its nature helps split up the problems so they can be scaled to as many CPUs as the OS has available for you.

    C++ has servived because its very flexible and if done properly very fast. Regretably its often not done properly, and you end up with slow, insecure code thats very likely to be of no use in 5 years time.

    As such i think we will see the dawn of the functional languages this coming decade, things like F# are really rather nifty, but if you prefer procedual C# (or C++++, see what they did there!) has implemented a lot of the aspects of lambdas, combined with tools like PLINQ (i've written my own version for working with time series) it can scale to many CPUs, how many is determined by the host (you don't want to blindly open up 8 threads because you see 8 cores if the user is watching a video say do you?).
    throw new ArgumentException (String, String, Exception)

  7. #6
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: Another probaly easy for you c++ question

    Quote Originally Posted by theanimus View Post
    no, you want a language that by its nature helps split up the problems so they can be scaled to as many cpus as the os has available for you.
    ada?

  8. #7
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Another probaly easy for you c++ question

    you know one of the modelers i used to work with swar by Ada95.
    throw new ArgumentException (String, String, Exception)

  9. #8
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: Another probaly easy for you c++ question

    Quote Originally Posted by TheAnimus View Post
    you know one of the modelers i used to work with swar by Ada95.
    http://asharp.martincarlisle.com/

  10. #9
    Get in the van. Fraz's Avatar
    Join Date
    Aug 2007
    Location
    Bristol
    Posts
    2,919
    Thanks
    284
    Thanked
    397 times in 231 posts
    • Fraz's system
      • Motherboard:
      • Gigabyte X58A-UD5
      • CPU:
      • Watercooled i7-980X @ 4.2 GHz
      • Memory:
      • 24GB Crucial DDR3-1333
      • Storage:
      • 240 GB Vertex2E + 2 TB of Disk
      • Graphics card(s):
      • Water-cooled Sapphire 7970 @ 1175/1625
      • PSU:
      • Enermax Modu87+
      • Case:
      • Corsair 700D
      • Operating System:
      • Linux Mint 12 / Windows 7
      • Monitor(s):
      • Dell 30" 3008WFP and two Dell 24" 2412M
      • Internet:
      • Virgin Media 60 Mbps

    Re: Another probaly easy for you c++ question

    Quote Originally Posted by crazyfool View Post
    ok i'm almost done on my coursework but one last thing i cannot get to work.
    I have a string that contains a year eg 2008 which i need to convert into an int or double... anyone plz
    That code I posted the other day would have done it...

  11. #10
    Get in the van. Fraz's Avatar
    Join Date
    Aug 2007
    Location
    Bristol
    Posts
    2,919
    Thanks
    284
    Thanked
    397 times in 231 posts
    • Fraz's system
      • Motherboard:
      • Gigabyte X58A-UD5
      • CPU:
      • Watercooled i7-980X @ 4.2 GHz
      • Memory:
      • 24GB Crucial DDR3-1333
      • Storage:
      • 240 GB Vertex2E + 2 TB of Disk
      • Graphics card(s):
      • Water-cooled Sapphire 7970 @ 1175/1625
      • PSU:
      • Enermax Modu87+
      • Case:
      • Corsair 700D
      • Operating System:
      • Linux Mint 12 / Windows 7
      • Monitor(s):
      • Dell 30" 3008WFP and two Dell 24" 2412M
      • Internet:
      • Virgin Media 60 Mbps

    Re: Another probaly easy for you c++ question

    Quote Originally Posted by TheAnimus View Post
    C++ has servived because its very flexible and if done properly very fast. Regretably its often not done properly, and you end up with slow, insecure code thats very likely to be of no use in 5 years time.
    Indeed. I think the major problem with C++ is that 80% of the developers understand at most 20% of the language. Worse still, each developer understands a different 20% of the language from the next.

  12. #11
    Registered+
    Join Date
    Jul 2008
    Location
    London
    Posts
    40
    Thanks
    0
    Thanked
    4 times in 4 posts

    Re: Another probaly easy for you c++ question

    C++ is still big and will be for a long time to come.

    Other languages that are/will be big are C# and Java (both quite similar although syntactically different) Once you have C++ the other will be easy.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Not a very technical Question, but a Question none the less.
    By chip35 in forum Help! Quick Relief From Tech Headaches
    Replies: 6
    Last Post: 24-03-2007, 09:05 PM
  2. The 78th Annual Hexus Quiz!
    By Stewart in forum General Discussion
    Replies: 19
    Last Post: 23-01-2005, 02:05 PM
  3. eBay question
    By Allen in forum General Discussion
    Replies: 6
    Last Post: 01-03-2004, 10:08 PM
  4. What is Question Time
    By Saracen in forum Question Time
    Replies: 0
    Last Post: 12-08-2003, 05:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •