Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Trying to understand a C command
docmur
post Dec 30 2005, 12:10 PM
Post #1


I Eat C Code for Breakfast
****

Group: Members
Posts: 276
Joined: 9-November 04
From: Canada Ontario
Member No.: 4,136



Okay so I'm working on a project in my computer sci class at WCI and I need some help with C

first what does the command unsigned do here's how I'm using it

unsigned char *memcpy

second how do pointers work like what does it mean when I point unsigned char to memcpy anyway

Thank

DOCMUR


--------------------
Gentoo ROCKS!!!!! Go and emerge the world
Go to the top of the page
 
+Quote Post
DS2K3
post Dec 31 2005, 09:04 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



I would hazard a guess that it creates an unsigned (scalar) variable. ie no positive/negative sign, just the magnitude.

D


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post
docmur
post Dec 31 2005, 10:45 AM
Post #3


I Eat C Code for Breakfast
****

Group: Members
Posts: 276
Joined: 9-November 04
From: Canada Ontario
Member No.: 4,136



okay and what do pointers do


--------------------
Gentoo ROCKS!!!!! Go and emerge the world
Go to the top of the page
 
+Quote Post
Geminias
post Jan 1 2006, 09:21 AM
Post #4


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 1-January 06
Member No.: 5,923



unsigned just means a positive integer. by default if you declare say: int variable; the int is signed by default meaning it can contain values between negative 32000 and postive 32000 (something like that), but if you make it unsigned your advantage is you can have up to postive 64000 but your disadvantage is you can't have any negatives.

a pointer is a difficult concept for beginners to grasp and i'm not getting paid to explain it while there are programmers who have written books on C which have gotten paid. But essentially it is a type of variable that contains an address. The point of a pointer is to be able to access data stored on the heap after a function returns (after it goes out of scope) .
Go to the top of the page
 
+Quote Post
Hemant
post Jan 2 2006, 09:36 AM
Post #5


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



By default...chars are basically signed integers, whose range is from -127 to +128..
So the first statement, creates a pointer "memcpy" that will point to a heap of unsigned characters.


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 02:55 PM