By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

Assert() in C

P: 41
Hi ,

Anyone know another approach to evaluate the 2 variables below rather than using the assert ()?


Thanks in advance

char arr[100], **arrp;
assert(arrp >= arr);
Feb 19 '07 #1
Share this Question
Share on Google+
3 Replies


DeMan
100+
P: 1,806
as far as I know (and I've bot used assert in c, though I have used similar things in java), assert (at it's simplest) does very little and is the same as doing something like this (in pseudo of cawz):

Expand|Select|Wrap|Line Numbers
  1. void myAssert(boolean check)
  2. {
  3.   if(!check)
  4.     printError();
  5. }
  6.  
So it should be pretty easy behaviour to mimic IO would think
Feb 20 '07 #2

P: 41
Does it not do some manipulation on the stack ?
Feb 21 '07 #3

DeMan
100+
P: 1,806
Not as far as I know (but as I said earlier, I'm judging c's assert based on what I know about Java Assertions, so I'm surwe someone will correct me if I'm wrong....)
Feb 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.