Passing pointers and arrays to a C function

In summary: p++; } break; case 2: while(*p) //while there is a character in the array, do something with it... *p = tolower(*p); //convert all chars to lowercase ... p++; } break; default: //do nothing, this is the default case printf("%s",val); //display the value of val }
  • #36
Math is Hard,

The ++ operator when used as *from++, is a post-increment operator. The value is incremented after it is evaluated in the expression. You are confusing it with the pre-increment use, *(++from).

- Warren
 
Physics news on Phys.org
  • #37
Thank you both. That cleared it up!

-Jessica
 

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
956
  • Programming and Computer Science
Replies
5
Views
896
  • Engineering and Comp Sci Homework Help
Replies
3
Views
763
  • Engineering and Comp Sci Homework Help
Replies
17
Views
1K
  • Programming and Computer Science
Replies
23
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
5K
  • Programming and Computer Science
Replies
2
Views
948
  • Engineering and Comp Sci Homework Help
Replies
11
Views
2K
  • Programming and Computer Science
Replies
6
Views
2K
Back
Top