473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

* sign in C

gautamz07
Why is * sign used in C language ?
Sep 19 '13 #1
1 1401
Nepomuk
3,112 Expert 2GB
Well, I guess Dennis Ritchie needed a sign and thought "The asterisk would look nice there." ;-)

I'm guessing however that your actual question is: "For what is the asterisk used?" And there are two answers I can give:
  1. For multiplications, e.g.
    Expand|Select|Wrap|Line Numbers
    1. int a = 7 * 9;
  2. For loads of things related to pointers, such as
    Expand|Select|Wrap|Line Numbers
    1. int   c, d;
    2.  int   *pj;
    3.  struct MyStruct astruct;
    4.  struct MyStruct *bb;
    5.  
    6.  c   = 10;
    7.  pj  = &c;             /* pj points to c */
    8.  d   = *pj;            /* d is assigned the value to which pj points, 10 */
    9.  pj  = &d;             /* now points to d */
    10.  *pj = 12;             /* d is now 12 */
    11.  
    12.  bb = &astruct;
    13.  (*bb).m_aNumber = 3;  /* assigns 3 to the m_aNumber member of astruct */
    14.  bb->num2 = 44.3;      /* assigns 44.3 to the num2 member of astruct   */
    15.  *pj = bb->m_aNumber;  /* eqivalent to d = astruct.m_aNumber;          */
    (Copied from http://en.wikibooks.org/wiki/C_Progr...ers_and_arrays)
If you want to learn about pointers, reading the article I took that example from is a good starting point.
Sep 19 '13 #2

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

Similar topics

9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
12
by: tarmat | last post by:
sorry for this silly little question, but whats the function to grab the sign of a value?
37
by: Claude Gagnon | last post by:
Hi, How can we compare sign of numbers in C++ ? Bye, Claude
10
by: Sona | last post by:
Hi, Could someone please explain what sign-extension means? If I have a hex number 0x55, how does this get sign-extended? Can a sign-extended counterpart be equal to -91? In a program I'm...
3
by: Jimmy | last post by:
I'm trying to find a website that does the following: 1. Signs you up to a second site under a different primary domain (i.e. as a result of a checkout or something). The username and password may...
6
by: Steve K. | last post by:
I recall a few months ago coming across an article allowing for encoding (or converting?) xml and html documents into sign language as well as brail for deaf and blind people, and that they were...
11
by: =?ISO-8859-1?Q?Konrad_M=FChler?= | last post by:
Hi, a simple question: Which standard function in c++ gives me the sign of a number? Thanks Konrad
2
by: Terry Chapman | last post by:
I have a 2003 Access .mda add-in which I can sign using my Thawte digital certificate. I am now migrating this add-in to Access 2007 and when I try to add my Thawte digital signature Access 2007...
29
by: Nick | last post by:
I've seen a few frameworks use the following: function $(id) { return document.getElementById(id); } Then to use: $('something').innerHTML = 'blah'; I'm just trying to roll this out to my...
20
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.