Killer_Typo 82 Master Poster

I've learned that what i actually write for clients and what I learned in class and books is pretty darn far apart and for the most part the instructor has become too far seperated from reality to give good advice.

You get a lot of "The book says..."

Killer_Typo 82 Master Poster

Here is a version I wrote based on your code and heavily commented :)

#include <iostream>
#include <fstream>
using namespace std;
int main( void )
{
 ifstream inFile;   // create a file reader
 inFile.open("vowels.txt"); // open the vowels.txt file
 char ch = '\0';    // holds each letter for testing
 int numz = 0;    // number of vowels counted
 
 // get the string from the file specified
 if (inFile.is_open())
 {
  while (inFile.read(&ch, 1))
  {
   cout << ch; // output the character
   switch (tolower(ch)) // test the character
   {
   case 'a': case 'e': case 'i': case 'o': case 'u': // what about sometimes Y too?
    numz++; // incriment the counter
    break; // stop the switch
   }
  }
  cout << endl; // close off the sentence
  inFile.close(); // we are done reading the file close the stream
 } else {
  printf("Failed Opening Stream\n"); // oops we couldnt open the stream
 }
 // show the user the number of vowels
 printf("The number of vowels: %d\n", numz);
 cin.get(); // wait for user input before closing
 return 0;
}
Killer_Typo 82 Master Poster

Make sure to test if the stream is open

inFile.is_open()

if it's not open your vowels.txt file is in the wrong directory.

that being said if you want I can PM you a working version, a little simpler, but i will wait till you struggle through a bit more before posting it :P

either way you've made good progress.

EDIT:

please remember that HI HELLO would look different than Hi Hello, your current statement would not count the vowels in the first uppercase version.

Killer_Typo 82 Master Poster

It can be tricky, there is a playSound function in C++ but it's not all that powerful so you may be best suited to look for a library to do that, or feel free to get your hands dirty with some DirectX.

:)

http://msdn2.microsoft.com/en-us/library/ms712879.aspx

Killer_Typo 82 Master Poster

DEL will not remove directorys

use RD <dirname> - only works if <dirname> is empty (ie. no files in it)

DELTREE <dirname> - will delete <dirname> and all subdirectorys even if it contains files

RD /S will achieve the same as DELTREE

Killer_Typo 82 Master Poster

>before because i just wanted to solve a problem real fast

But it is not your homework.

yeah...okay fine. i did this for another site buddy ;)

Killer_Typo 82 Master Poster

Just look at how many times sqrt() is called inside the loop.
Use another variable, and save the result ONCE outside the loop.

lol sure, that works i wrote that in about ~5min before because i just wanted to solve a problem real fast, optimizations will come later when i get to the much harder problems on projecteuler.net :(!

also note (wouldnt let me edit) and i need to add that the number being square rooted needs to be rounded up and incrimented by one to work in all cases, my little mistake will cause accuracy errors in the math.

Killer_Typo 82 Master Poster

hehe, i just wrote a counter that will go all the way up to 10001 instantly, though i havnt tested it for higher values.

super simple and absolutely NO goto's.

#include <iostream>
#include <math.h>
int main( void )
{
    // count to the 10001'st prime
    int primeCount = 2;
    // only count odd numbers: 15, 17, 19...etc
    for(int count = 5; primeCount <= 10001 ;count += 2)
    {
        for (int test = 2; test <= (int) sqrt((double) count);test++ )
        {
            if ((count % test) == 0)
                // number divides in, cannot be prime
                break;
            if (test == ((int) sqrt((double) count)))
                // final loop and no match
                primeCount++;
        }
        if (primeCount == 10001) 
        {
            std::cout << "Prime Count\t\tCurrent Prime" << std::endl;
            std::cout << "-----------\t\t-------------" << std::endl;
            std::cout << primeCount << "\t\t" << count << std::endl;
            std::cin.get(); // hold before exiting application
            break;
        }
    }
    return 0;
}
Killer_Typo 82 Master Poster

what are C compilers written in?

C?

Assembley?

:D
which came first: the chicken or the egg!!

Killer_Typo 82 Master Poster

The interface is far to cluttered to use efficiently especially when browsing search results.

I had to close the page as soon as my results came back because it was far to much work for my eyes to find anything of real value.

Killer_Typo 82 Master Poster

In my opinion, gentoo is a waste of time. It just seems to me that people who use gentoo are non-developers wanting to look 1337 by showing their friends gcc output...

hehe, well i do all my developing on my windows box :D

however i liked gentoo because i found it easy to work with, setup, install...etc

i found install applications on it to be easier than any distro of linux that i had ever used.

personally when it comes to linux i prefer to have specific uses. It will never be a desktop OS. BUt if i am going to setup a samba server install to communicate with active directory and act as the user management side of it as well as a packet-filtering box that is all good with me!

Killer_Typo 82 Master Poster

i prefer gentoo

emerge world :D


i found working in gentoo to be the best of any linux experience.

Killer_Typo 82 Master Poster

>in fact my first time running fedora when i was trying to update the system it crashed, locked up and i couldnt do anything. I had to hard restart the system.

Fine, good distros almost never crash. I've never had to reboot on my system.

haha well i wont argue with fedora not being a good distro.


They used to be pretty big ( am sure they still are ) but they dont seem to be as appealing as SuSE is or even Ubuntu.

Not sure what happened, it is like fedora quality has slipped.

Killer_Typo 82 Master Poster

>ummm...i've had linux crash and be just as flaky as windows.

You have had linux crash? Impossible. The X server might crash or a tty but Linux (almost)never has kernel panics.

hahahah impossible, now that is niave about OS

in fact my first time running fedora when i was trying to update the system it crashed, locked up and i couldnt do anything. I had to hard restart the system.

Killer_Typo 82 Master Poster

actually have a handfull of those books at work. the only important ones to use are from visual works or just smalltalk80 books because of the age of the distro we are using.

Killer_Typo 82 Master Poster

Thats no excuse for being unstable. Linux supports the more pieces of hardware than any other OS ever made and it is extremely stable.

ummm...i've had linux crash and be just as flaky as windows.


It is hard to call one version of an OS more stable than another. In fact a properly treated install of windows runs great and can be left running continously with no problems.

the same could be said of *nix.

what's funny is that people try to say that it is more unstable over another OS when windows has had far more testing and development. You see more of windows errors/flaws/bugs...etc because it gets more testing from the end user because it almost completely dominates the market share.


However wehn setting up linux (be it SuSE, Gentoo, Ubuntu, Fedora...etc) i can run into just as many errors, a lot of which are due to poor hardware support but i wont ever hear that on the news or on mainstream outlets because nobody cares about that.

Killer_Typo 82 Master Poster

which smalltalk are u using ?

VisualWorks

www.cincomsmalltalk.com

At work we are using version 2.5.1 even though they are currently on version 7+

Killer_Typo 82 Master Poster

Smalltalk hello world

Transcript show: 'hello world'.

or

Dialog warn: 'hello world'.

or

'hello world' inspect.
Killer_Typo 82 Master Poster

a lot of windows instability comes from the need to support so much, IE 95% of the market share.

It is hard to write an OS (i would assume) that requires the support of nearly every peiece of software / hardware developed.

Not to mention with so many people that could be using a specific version at any given time it is no wonder that you hear about all of its bugs/flaws.

I would rather hear that then nothing at all!

Killer_Typo 82 Master Poster

are you sure?

what OS?

i just opened up the command prompt and typed


IF EXIST Desktop ECHO hi

my prompt Echo'd out HI

to test i wrote


IF EXIST DirThatDoesNotExist ECHO hi

nothing was echo'd back out!

Killer_Typo 82 Master Poster

Since i am going to have to learn Smalltalk well enough to convert it to .NET ( or so i have been told )

i decided to convert some of the C++ tutorials to Smalltalk.

Namely this one:

Write a program which performs addition, subtraction, multiplication of matrices. The dimensions of both the matrices would be specified by the user (dynamic memory allocation required). Use of structure or a class to define the matrix would be a good idea. (Expert)

Here is the output,

in its current state it can only add matrices but i will manage that later on.

I would have loved to uses classes and methods like in any modern language but since the version we are using here at work is about 12 years old and adding support for classes is cryptic at best i will simply hold out for now and submit my sad version :lol:

"
 Adding matrices together
"
| matriceA matriceB matriceResult matriceHeight matriceWidth mCountH mCountW mMessage |
 Transcript clear.
 
 "setup the initial heights and widths"
 matriceHeight := 0.
 matriceWidth := 0.
 [ ( ( matriceHeight > 0 ) & ( matriceWidth > 0 ) ) ] whileFalse: [
  matriceHeight := ( Dialog request: 'Please enter the height of the matrices' initialAnswer: 2 ) asNumber.
  matriceWidth := ( Dialog request: 'Please enter the width of the matrices' initialAnswer: 2 ) asNumber.
 ].
 
 "Create a collection at MatriceA, this collection is matriceHeight in size with each item …
Killer_Typo 82 Master Poster

I don't think so. the result will be the fllowigs:
a=b;
b=0;
I am a beginner:) please give me some advice

actually it does work

assume a = 3 and b = 7

a = a + b

a = 10
b = 7

b = a - b
a = 10
b = 3

a = a - b
a = 7
b = 3

however from the responses this doesnt seem to be a very safe way of handling things.

Killer_Typo 82 Master Poster

Looks like Smalltalk's syntax is nicer looking and more elegant.

no way


after reading up on some tutorials it is actually poorly written if you ask me.

| myFile myStream myLine addrIP mySet contents sFound eFound logDirectory | 
    Transcript clear.
    logDirectory := 'c:\vw7.4'. 
    contents := logDirectory asFilename directoryContents. 
    contents do: 
             [ :each | 
               sFound := each findString: 'ws00' startingAt: 1.
               eFound := each findString: '.log' startingAt: 7.
               (sFound > 0) & (eFound > 0)
               ifTrue:
               [ mySet := Set new. 
                 myFile := logDirectory asFilename construct: each.
                 myStream := myFile readStream. 
                 [ myStream atEnd ] whileFalse: 
                   [ myLine := myStream upTo: Character cr. 
                     addrIP := myLine copyUpTo: $,. 
                     mySet add: addrIP.
                   ]. 
                 myStream close.
                 Transcript show: each, '...', mySet size printString; cr.
               ].
             ].

there are quite a few things syntaticly (if thats even a word) speaking that write and work poorly.

Killer_Typo 82 Master Poster

how many of you out there use and what about it do you find usefull or to be a headache.

I will be using it on a new system i was just picked up to support, the primary interface will be written in .NET languages but i will need to support some legacy stuff that will require Smalltalk.

So far (after some research) i have found that i am not much a fan of the syntax.

C# array:

string mystring = new string[] { "some string", "some string"  };

where as in smalltalk the syntax is something like

mystring ← #('data1' 'data2' 'data3');

other things that are quite odd, but i wont waste anyones time with it.

Killer_Typo 82 Master Poster

i've been through enough interviews to know that there is no answer to this question.


pickup the C# pocket reference as that will be your best friend though.

Killer_Typo 82 Master Poster

The Problem is using the method

g.DrawString("Text in Picture", new Font("verdana", 12), SystemBrushes.WindowText, 0, 0);

I put the settings for visual appearance in remarks and still get the same problem.
When not using the method DrawString and only saving the file with Bitmap.save the picture stay with the same size.
Why the method DrawString is resizing my picture?
Thanks

i would assume that because you are drawing on the image when you save the image the compression is re-applied to the image.

Killer_Typo 82 Master Poster

Hi to all I hope you can help with the following issue I have, thanks in advance.
I'm working in an application that insert text to pictures.
The problem is that after inserting the text, the size of the new pictures is smaller(in KB). I'll explain myself the original picture its size is 468KB and after inserting the text the new picture has the size 93KB. I'm wandering why the picture is smaller, I'm guessing I'm loosing quality or something else, but I don't know what (BTW the picture stay with the same dimensions (1024x768)).
This is the code I'm working to insert the text

Bitmap bitmap = new Bitmap(@"C:\pics\mypic.jpg");
Graphics g = Graphics.FromImage(bitmap);
//Set quality to High
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
//String to draw in Picture
g.DrawString("Text in Picture", new Font("verdana", 12), SystemBrushes.WindowText, 0, 0);
//New name of the new picture with text
bitmap.Save(@"C\pics\mypicwithtext.jpg", bitmap.RawFormat);

Thanks

try writting the string on the image but comment out the quality settings and save, i do believe it is due to that the image size is changing.

When i save an image using Bitmap.save("someimage", rawformat) the image size does not change, but i also do not specify any settings for the visual appearance.

Killer_Typo 82 Master Poster

he probably left off his method declaration

private void LoadScenario( string[,] Vars ) {
}
 
//but if you only need one portion of the string in vars
 
private void LoadScenario(string Vars) {}
 
//then call like this..
//assume we are inside of a class at this point
 
LoadScenario(vars[x,y]);
 
//where x is some int within bounds
//where y is some int within bounds
Killer_Typo 82 Master Poster

yes it can be a bit of a pain at first but using the windows api it can be done :)

this is of course in windows, you need to specify the OS for a more specific answer.

http://msdn2.microsoft.com/en-us/library/ms632587.aspx

Killer_Typo 82 Master Poster

Okay here is some code I have made:

/*=============================================
 
    Number Guessing Game
    Uses the srand() function and loops.
    James Duncan Bennet - james.bennet1@ntlworld.com
  ===========================================*/
 
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <string>
 
using namespace std;
 
    int guess = 0;
    int tries = 0;
    string line;
 
 int main()
{           
    srand(time(0));
 
    int randomNumber = rand() % 50 + 1; // Generate a random number between 1 and 50
 
    cout << endl << "The Number Guessing Game" << endl; // Display a welcome message for the user
 
    ifstream infile ("hiscore.txt");   // Open hiscore file for reading
 
    cout << "The highscore is: ";
 
    while (! infile.eof() ) //Check the whole file
    {
      getline (infile,line);
      cout << line ;
    }
    infile.close();
 
    cout << endl;
 
    do
    {
        cout << endl << "What is your guess? (1-50): ";
        cin >> guess; // Put the user input in the variable "guess"
 
        if (guess < randomNumber) // If the users guess is less than the random number
            cout << "Too low. Try again!" << endl; 
 
        if (guess > randomNumber) // If the users guess is more than the random number
            cout << "Too high. Try again!" << endl;
 
        tries++; //Increment "tries" by 1 each loop
 
    } while (guess != randomNumber); // Loop it while the users guess is not equal to the random number
 
    cout << endl << "Ta-Dah! Thats the number I was looking for!" << endl;
    cout << "It took you: " << tries << " attempts to guess the correct answer.\n" << endl; //Some …
Killer_Typo 82 Master Poster

Hey, is the Java VM written in C++ ?

i do believe that both the language and VM are created using C++.

Killer_Typo 82 Master Poster

yeah, I see your point Bench, but I suggested Pascal because of the simplistic syntax and it will allow people to start coding straight away, allowing the learner to get to grips with a few basics before going on to OOP.

it's not impossible for a complete beginner to go to Java first and I absolutely recommend it - which is why I stated Java would be a good language to start with.

I should have been more specific about what i stated, if a learner starts with pascal it's not necessary to spend years on it, perhaps a couple of months to help them get a feel for a programming language and so they don't feel so 'overwhelmed' at first, also don't forget society has changed, we are in a results society whereby individuals want things done 'NOW' not yesterday.

I would rather start with:

uses crt;

var
num1 : integer;
num2 : integer;
sum : integer;

begin
sum := num1+num2;
writeln('Total = ', sum);
end.

than:

public class sum
{
int num1;
int num2;
int total;

public static void main(String[] args)
{
total=num1+num2;
System.out.println("Total = "+total);
}
}

why not just start with C++

#include <iostream>
#include <string>
using namespace std;
int main ( void )
{
    cout << "hello world";
}
Killer_Typo 82 Master Poster

Actually, it's a part of a bigger function..
i only quote some parts which i don't know how to convert it into C#...

yes, you're great but how about these codes :

StrMsg.Format("Card Serial: %02x %02x %02x %02x %02x %02x %02x ",ResultSN[0],ResultSN[1],ResultSN[2],ResultSN[3],ResultSN[4],ResultSN[5],ResultSN[6] );

actually i don't know VC++, so i'm wondering how to have this code in C#...? pls help.

not quite sure on that last part, but i am guessing C# has a similar behavior for formatting strings.

Killer_Typo 82 Master Poster

working on my setup here

#include <iostream>
#include <map>
#include <string>
using namespace std;
class x
{    char str [40];
    public:
        x () {strcpy (str,"");}
        x (char *s) {strcpy (str,s);}
        char *get(){return str;}
};
bool operator< (x a, x b)
{    return strcmp (a.get(),b.get())<0;
}
class y 
{    char str [80];
    public:
        y() {strcmp(str, "");}
        y (char *s) {strcpy (str,s);}
        char *get () {return str;}
};
int main ()
{    map <x, y> mappy;
    mappy.insert (pair<x, y> (x ("dog"), y("Lassie")));
    mappy.insert (pair<x, y> (x ("cat"), y("Garfield")));
    mappy.insert (pair<x, y> (x ("whale"), y("Free Willy")));
    mappy.insert (pair<x, y> (x ("fox"), y("firefox")));
    mappy.insert (pair<x, y> (x ("bird"), y("eagle")));
    mappy.insert (pair<x, y> (x ("puma"), y("shoe brand")));
    mappy.insert (pair<x, y> (x ("lion"), y("lion king")));
    mappy.insert (pair<x, y> (x ("mouse"), y("mickey mouse")));
    char str[80] = { '\0' };
    cout << "Enter word: \n";
    while (cin.getline(str, 80)) {
        if ( std::char_traits<char>::compare(str,"quit",4) == 0 )
            break;
        map <x, y>:: iterator p;
        p = mappy.find (x(str));
        if (p != mappy.end()) {    
            cout << "" <<p-> second.get();
            cout << "\n\n";
            cout << "Enter word: \n";
        }
        else
            cout << "Not here, type again. \n";
        //reset the char[] to null on all values, this is because
        //after a loop if the user does not enter a value larger than
        //the previous then there will be left over garbage in the char[]
    }
    return 0;
}
Killer_Typo 82 Master Poster

Right now it is also pretty worthwhile to learn C#

languages i would recommend (through countless hours of interviews and job searches) are C, C++, C#, and Possibly ASP.NET (if you are interested in web based applications).

I have found that there are a supprisingly large number of people looking for these qualifications (well not so supprisngly for C / C++ :) )

Killer_Typo 82 Master Poster

i will post the conversion for you, give me a minute.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WinAPI
{
    public partial class Form1 : Form
    {
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender , EventArgs e) {
            byte[] ResultSN = new byte[11];
            char[] SN = new char[100];
            byte TagType = new byte();
            if ((TagType == 4) || (TagType == 5))
            {
                winapi.memcpy(SN , ResultSN , 7);
            }
        }
    }
    class winapi
    {
        [DllImport("msvcr71.dll" , CharSet = CharSet.Auto)]
        public static extern void memcpy(char[] src , byte[] dest , int count);
    }
}

you should note though that this code actually does nothing, because it has no return type and because when i try to use pointers (via the unsafe context) it throws errors it is probably pointless to continue trying to convert this.

Killer_Typo 82 Master Poster

Possibly, but not necessarilly.
You can just as well write a JVM in say Fortran or Assembly.
Or create one in hardware.
Anyway, the language a compiler or operating system is written in is no indication that you should know that language first before you can master the language that compiler compiles.

I am pretty sure they are. If you go to java's website and grab the SDK's and tool kits they all come packed as C++

Killer_Typo 82 Master Poster

pick up the C# pocket reference, cant go wrong with a book that leaves out the filler and gives you what's important. :)

Killer_Typo 82 Master Poster

If the solution fits the requirements as laid out in the requirements document the customer signed off on as part of their contract, then yes he has to pay for it.

I'd (if I found out that the actual technical needs are different from what the customer stated) notify the customer that the requirements (and thus the contract) had better be ammended (possibly introducing extra cost for the customer, depending on the extra effort or investment needed on our part) or the software wouldn't meet his needs (rather than his stated requirements), but I would need to have some idea of the actual use he was going to make of the stuff beforehand.

i've worked with clients in which they never knew what they wanted, so matter how much questioning and work we did he always wanted "more" he always wanted a new expensive feature added, which i was fine with :)

my only gripe was that i was ready to go public and begin versioning the product we had a solid peice of software that he was ready to begin pushing, just sucks we had to part ways because his funding ran dry with all his new idea / features he wanted to add.

Killer_Typo 82 Master Poster

Are you trying to make an ass out of yourself?

here try this one then. VB sucks, the language is weak and there is no supprise that VB works better as a scripting language (dur VBScript) than VB works as a software language. hope that clears things up for you ;)

Killer_Typo 82 Master Poster

ah, so another fictional delusion?

basically.

hahah would not be supprised if billy gates himself wrote that.

i'm not a windows basher but billy gates sure does love his visual basic even though it works better for scripting.

Rashakil Fol commented: Lame. BY READING THIS MESSAGE YOU AGREE TO FORGO ALL RIGHTS OF LIABILITY AND CHILD-BEARING, AND YOU AGREE TO INDEMNIFY Rashakil Fol FROM ALL FORMS OF FLATULENCE. -2
Aia commented: Just correct the misspellings: SOMTHING should be SOMETHING and AMMOUNT should be AMOUNT. +6
Killer_Typo 82 Master Poster

>but as a software langugage to handle any task it is a major joke.
Incorrect.

i am sure we could both find people to argue both sides of the fence ;)

it's no use for either one of us to argue it, but i am basing this on personal trial/error using VB and VB's basic grammar/structure.

Killer_Typo 82 Master Poster

VB reads like a childrens book.

the grammar and structure is poorly created.

DIM foo AS something = something;

or instead of using the "this" keyword it uses ME

ME.foo

(which reads terrible, is is like saying, me contain foo, instead of this contains foo)

instead of NULL or csharps null (just casing difference) VB uses NOTHING

DIM foo as SomeObject = NOTHING;

VB works great as a scripting language, and is implimented well for that, but as a software langugage to handle any task it is a major joke.

Killer_Typo 82 Master Poster

Ok I have a bug that is very hard to pinpoint. Upon Compilation I get

Thanks to all concerned. I got it figured. What I did was include a
Function header( not a class) and did not inline the Functions or
should I say didn't declare them well anyway It works now

Thanks again

awesome


cheers!

Killer_Typo 82 Master Poster

i did a google on the error you posted but didnt get much (put it in quotes to hope to find someone with the same error)

doing a little rearranging this was the best i could find

Memory Leaks


A memory leak is a loss of available memory space. This occurs when dynamic data are no longer needed in the program, but the memory that is used has not been deallocated. It can also occur when an assignment is made to a pointer variable that already holds the address of an allocated area.
Each time a memory leak occurs, the application drains the available memory pool. Even in virtual-memory systems, the gradual increase in application size can result in performance degradation that affects the entire system. Eventually, this performance degradation can lead to a fatal out-of-memory condition that may be encountered by an application unrelated to the one that caused the memory leak in the first place.
Tip: make sure you match allocation calls with deallocation calls when doing unit testing, particularly where there might be an early return from a function where dynamic data was allocated. It's also essential to check, before assigning to a pointer, that the memory accessible via that pointer is freed prior to the assignment or made accessible some other way.

Killer_Typo 82 Master Poster

> after messing around with strtok_s for a bit i found that this version was a bit more easy to use.

is strtok_s standard c++ then?

no concern of mine, do some searching around online and you will find a great wealth of information on both strtok and strtok_s

cheers.

Killer_Typo 82 Master Poster

post your code please :)

Killer_Typo 82 Master Poster

Goal: Reverse words in a sentence without destroying sentence and without using STL.

Assumptions:
1) Input sentence not longer than 6400 char
2) Less than 81 words per sentence
3) Each word less than 81 char long
4) Output is a sentence with words reversed
Weakness---assumptions may not be appropriate

Strength---avoids need to create user defined container to hold words parsed from input before reversal is accomplished.

i had read online that strtok may not be safe and the better version to use is strtoke_s

after messing around with strtok_s for a bit i found that this version was a bit more easy to use.

Killer_Typo 82 Master Poster

>how much buffer or say... space in memory...? does that variable may take up to?
You'll have to rephrase your question. I'm not sure what answer you're looking for.

i think he/she may be asking what is the maximum ammount of information a char * can take.

or what is the max buffer size for the getline statement

Killer_Typo 82 Master Poster

>i had wondered how to allocate more instead of using a constant char foo[100];
It's great, you can use a similar syntax to allocate more than one:

char *p = new char[100];

This creates 100 characters and points p to the first of them.

>i remember someone posting about using cin.flush to remove any characters from the buffer
They were probably wrong. I say probably because flush is a valid operation on an ouput stream. It forces any characters in the stream buffer to be written to the destination.

cool, all makes sense to me now :)