Forum: C++ Dec 3rd, 2007 |
| Replies: 4 Views: 664 |
Forum: C++ Dec 3rd, 2007 |
| Replies: 4 Views: 664 for the for loop
for ( ; *source!='\0'; source++)
what is the purpose of the semicolon in the for loop ?
thank you! |
Forum: C++ Dec 2nd, 2007 |
| Replies: 2 Views: 437 thank you! this clarifies much confusion I was experiencing. |
Forum: C++ Dec 2nd, 2007 |
| Replies: 2 Views: 437 if " int*& ptr " is declared as a parameter of a function, what does it do?
for example:
findMax(int arr[], int n, int*& ptr) |
Forum: C++ Nov 28th, 2007 |
| Replies: 7 Views: 895 umm.. is it array[1] which is origially 3 set to 9? |
Forum: C++ Nov 27th, 2007 |
| Replies: 7 Views: 895 okies..
so this is what i thought:
ptr+= 2
increases the pointer by two.. so the ptr will now point to array[2]
and ptr[1] =9
the value of index 1 is equal to 9.. |
Forum: C++ Nov 27th, 2007 |
| Replies: 7 Views: 895 wow thank you!
then in addition, what does
ptr+= 2
and ptr[1] =9
do?
thank you!! |
Forum: C++ Nov 27th, 2007 |
| Replies: 7 Views: 895 what does the following do?
int array[6] = { 5, 3, 4, 17, 22, 19 };
int* ptr = array[0]
*ptr = -1;
thank you! |
Forum: C++ Nov 20th, 2007 |
| Replies: 1 Views: 1,449 Hello, I am trying to "peek" the next character to see if it is a character. If the word exceeds the max linelength it should be written in the next line with the count starting from zero again.
... |
Forum: C++ Nov 19th, 2007 |
| Replies: 3 Views: 1,065 I'm trying to copy all the lines/character in a file into an array so that i can reformat the text. Thank you for your help!!! |
Forum: C++ Nov 19th, 2007 |
| Replies: 3 Views: 1,065 const int MAX=200;
char line[MAX];
char s2[MAX];
inf.getline(line,MAX);
for(;;)
{
for(int i=0; i < MAX ; i++)
{ |
Forum: C++ Nov 19th, 2007 |
| Replies: 7 Views: 10,099 |
Forum: C++ Nov 18th, 2007 |
| Replies: 7 Views: 10,099 the code i have so far is:
int reformat(istream& inf, ostream& outf, int lineLength)
{
char newlines;
inf.get(newlines);
while (inf.get(newlines))
{
if (newlines != '\n') |
Forum: C++ Nov 18th, 2007 |
| Replies: 7 Views: 10,099 how can you exactly do that? thanks! |
Forum: C++ Nov 18th, 2007 |
| Replies: 7 Views: 10,099 I have a project where I need to reformat a plain text file.
for example,
Hello nice to meet
you.
Glad to be here.
will be reformatted to the following: |