C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 6th, 2006, 10:48 AM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
True or false

1) Which of these assignments are correct? If they are wrong, why?

int a[5];
int b[6];

a = b;
*a = b;
*a = *b;
a = *b;

2) Which of these assignments are correct? If they are wrong, why?

int a[5];
int *b;

b = a;
*b = a;
b = *a;
*b = *a;
a = b;
*a = *b;
a = *b;
*a = b;

Reply With Quote
  #2  
Old March 6th, 2006, 11:13 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 997 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2Folding Points: 906075 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 14 h 26 m 27 sec
Reputation Power: 5
Send a message via ICQ to Itsacon
You kind of double posted this, and it does definitely not belong in the java forum, for Java doesn't have pointers (at least, it doesn't make any distinction between one or the other)
__________________
This is my code. Is it not nifty?

"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams


Join the Itsacon fanclub!    
Zero Tolerance: Spammers banned so far: 280

Reply With Quote
  #3  
Old March 7th, 2006, 08:48 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
I've moved this to the C/C++ forum... if it's a double post, one should be removed.

jandali, can you give us a little more context around the question?
without the surrounding code and any potential errors, it just sounds like you're asking us to do your homework.

Your best bet to test which ones are right and wrong (if you can't figure out by looking) is to simply compile the code and see what happens. ;-)
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #4  
Old March 8th, 2006, 02:10 AM
jandali jandali is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 18 jandali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
I've moved this to the C/C++ forum... if it's a double post, one should be removed.

jandali, can you give us a little more context around the question?
without the surrounding code and any potential errors, it just sounds like you're asking us to do your homework.

Your best bet to test which ones are right and wrong (if you can't figure out by looking) is to simply compile the code and see what happens. ;-)

no it was just question i was doing for studying for midterm.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > True or false


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT