Click here to Skip to main content
15,896,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionJPEG image display Pin
CPP91126-Apr-06 4:52
CPP91126-Apr-06 4:52 
AnswerRe: JPEG image display Pin
Russell'26-Apr-06 5:08
Russell'26-Apr-06 5:08 
AnswerRe: JPEG image display Pin
KellyR26-Apr-06 5:12
KellyR26-Apr-06 5:12 
AnswerRe: JPEG image display Pin
Hamid_RT26-Apr-06 18:46
Hamid_RT26-Apr-06 18:46 
QuestionYour comments for Font-Editor Pin
includeh1026-Apr-06 4:47
includeh1026-Apr-06 4:47 
Questiondraw a thin line with anti-aliasing as Font! Pin
includeh1026-Apr-06 4:43
includeh1026-Apr-06 4:43 
AnswerRe: draw a thin line with anti-aliasing as Font! Pin
Shog926-Apr-06 17:53
sitebuilderShog926-Apr-06 17:53 
Questionarray Pin
#hackC++26-Apr-06 4:42
#hackC++26-Apr-06 4:42 
This is the array program I made last night.


/* A stupid array program that I made when I was bored one night */<br />
<br />
#include iostream  <br />
using namespace std;<br />
<br />
int main()<br />
{<br />
    const size_t arsize = 27;<br />
    int a[arsize] = {0,1,2,3,4,5,6,7,8,9,10,<br />
                     11,12,13,14,15,16,17,18,<br />
                     19,20,21,22,23,24,25,26,};<br />
                       <br />
    a[0] = 'a';  a[1] = 'b';<br />
    a[2] = 'c';  a[3] = 'd';<br />
    a[4] = 'e';  a[5] = 'f';<br />
    a[6] = 'g';  a[7] = 'h';<br />
    a[8] = 'i';  a[9] = 'j';<br />
    a[10] = 'k'; a[11] = 'l';<br />
    a[12] = 'm'; a[13] = 'n';<br />
    a[14] = 'o'; a[15] = 'p';<br />
    a[16] = 'q'; a[17] = 'r';<br />
    a[18] = 's'; a[19] = 't'; <br />
    a[20] = 'u'; a[21] = 'v';<br />
    a[22] = 'w'; a[23] = 'x';<br />
    a[24] = 'y'; a[25] = 'z';<br />
    a[26] = ' ';<br />
<br />
    int input; <br />
    string cool;<br />
    int end = 99;<br />
    <br />
    cout << "Programmed By Cody Rentschler\n" << endl;    <br />
    cout << "Alphabit Array testing." << endl;<br />
    cout << "Numbers 0 - 26 only." << endl;<br />
    cout << "Input 99 to exit out of loop." << endl;<br />
    <br />
    for (int can = 0; can != 1000000; cool.push_back(a[input]))<br />
        {<br />
             cin >> input;<br />
             cin.ignore(100,'\n');<br />
             if (input == end)    // To get out of for loop<br />
             {<br />
                       break;<br />
             }<br />
             <br />
             if (input > 26)<br />
             {<br />
                       cout << "Error: Number to big" << endl;<br />
                       cin.get();<br />
                       system("cls");<br />
                       return main();<br />
             }<br />
             <br />
             if (input < 0)<br />
             {<br />
                       cout << "Error: Number to small" << endl;<br />
                       cin.get();<br />
                       system("cls");<br />
                       return main();<br />
             }<br />
             ++can;<br />
             <br />
        }<br />
        <br />
        cout << "\n\n\n\n" << endl;<br />
        cout << cool << endl;<br />
        cin.get();<br />
  <br />
    <br />
    return 0;<br />
} 


Is this and example of how an array works or am I
using this function wrong.

Just wondering because i'm trying to figure out how arrays work.

Or is there an easier way to do this same program?
AnswerRe: array Pin
Russell'26-Apr-06 5:02
Russell'26-Apr-06 5:02 
QuestionRe: array Pin
David Crow26-Apr-06 5:52
David Crow26-Apr-06 5:52 
AnswerRe: array Pin
#hackC++26-Apr-06 7:38
#hackC++26-Apr-06 7:38 
GeneralRe: array Pin
David Crow26-Apr-06 7:54
David Crow26-Apr-06 7:54 
QuestionSave array Pin
christinalimsw26-Apr-06 4:14
christinalimsw26-Apr-06 4:14 
AnswerRe: Save array Pin
David Crow26-Apr-06 4:17
David Crow26-Apr-06 4:17 
GeneralRe: Save array Pin
christinalimsw26-Apr-06 22:27
christinalimsw26-Apr-06 22:27 
GeneralRe: Save array Pin
David Crow27-Apr-06 2:35
David Crow27-Apr-06 2:35 
AnswerRe: Save array Pin
Hamid_RT26-Apr-06 18:47
Hamid_RT26-Apr-06 18:47 
QuestionLooking for a good tutorial on OOP Pin
eli1502197926-Apr-06 4:12
eli1502197926-Apr-06 4:12 
AnswerRe: Looking for a good tutorial on OOP Pin
valikac26-Apr-06 6:47
valikac26-Apr-06 6:47 
QuestionHow to add an application in VC++ to the system tray Pin
mad_john26-Apr-06 2:30
mad_john26-Apr-06 2:30 
AnswerRe: How to add an application in VC++ to the system tray Pin
toxcct26-Apr-06 2:32
toxcct26-Apr-06 2:32 
AnswerRe: How to add an application in VC++ to the system tray Pin
Fred Ackers26-Apr-06 2:43
Fred Ackers26-Apr-06 2:43 
AnswerRe: How to add an application in VC++ to the system tray Pin
David Crow26-Apr-06 3:02
David Crow26-Apr-06 3:02 
AnswerRe: How to add an application in VC++ to the system tray Pin
Hamid_RT26-Apr-06 19:03
Hamid_RT26-Apr-06 19:03 
Question[Message Deleted] Pin
ddmcr26-Apr-06 1:43
ddmcr26-Apr-06 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.