Go Back   Zuneboards > General Discussions > Technology

Technology Tech. Talk

Closed Thread
 
LinkBack Thread Tools
Old 01-28-2010, 11:28 PM   #1 (permalink)
Super Zuner²
 
ChurchedAtheist's Avatar
 
Join Date: Nov 2006
Posts: 3,725
ChurchedAtheist is a splendid one to beholdChurchedAtheist is a splendid one to beholdChurchedAtheist is a splendid one to beholdChurchedAtheist is a splendid one to beholdChurchedAtheist is a splendid one to beholdChurchedAtheist is a splendid one to behold
Default string concatenation and output to external program

scraped the old code, as I have largely redone the code.

Code:
#include <iostream>
#define NOMINMAX
#include <windows.h>
#include <string.h>
#include <sstream>

using namespace std;

int main ()
{
	int chapter;
	int section;
	int prob_number;

  cout << "What chapter is this? :";
cin >> chapter;
cout << "What section is this? :";
cin >> section;
cout << "What problem is this? :";
cin >> prob_number;

string sectionletter;
switch (section){
  case 1:
    sectionletter = "a";
    break;
  case 2:
    sectionletter = "b";
    break;
  case 3:
    sectionletter = "c";
    break;
  case 4:
    sectionletter = "d";
    break;
  case 5:
    sectionletter = "e";
    break;
  case 6:
    sectionletter = "f";
    break;
  case 7:
    sectionletter = "g";
    break;
  case 8:
    sectionletter = "h";
    break;
  case 9:
    sectionletter = "i";
    break;
  case 10:
    sectionletter = "j";
    break;
  case 11:
    sectionletter = "k";
    break;
  case 12:
    sectionletter = "l";
    break;
  case 13:
    sectionletter = "m";
    break;
  default:
    sectionletter = "0";
}


string result1;
stringstream tbuf1;
tbuf1.width(3);
  tbuf1 << right << prob_number;
tbuf1 >> result1;

string result2;
stringstream tbuf2;
tbuf2.width(2);
  tbuf2 << right << chapter;
tbuf2 >> result2;

string urllink = "http://calcchat.tdlc.com/solutionart/calc9e/"+result2+"/"+sectionletter+"/se"+result2+sectionletter+"010"+result1+".png";

ShellExecuteA(NULL, "open", urllink.c_str(), NULL, NULL, SW_SHOWNORMAL);
  return 0;
}

using seperate stringstreams for prob_number and chapter gets me 404 Not Found

just need the 0 out front
__________________

Quote:
Originally Posted by Marcus Aurelius
Live a good life. If there are gods and they are just, then they will not care how devout you have been, but will welcome you based on the virtues you have lived by. If there are gods, but unjust, then you should not want to worship them. If there are no gods, then you will be gone, but will have lived a noble life that will live on in the memories of your loved ones.

Last edited by ChurchedAtheist; 01-29-2010 at 12:08 PM.




ChurchedAtheist is offline  

Advertisement [Remove Advertisement]
Closed Thread

Bookmarks

Thread Tools