473,473 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to make this code error free

hello,
I am trying following code but it has errors how to solve that
and please help to know difference between value assigned to
pointer/reference?
#include <stdio.h>
void main()
{
int i;
int &k=i;
k++;
printf("val of i is %d\n",i);
k=200;
printf("val of i is %d\n",i);
int *p=&i;
p++;
printf("val of p is %d\n",p);
printf("val of i is %d\n",i);
}

Nov 15 '05 #1
5 1124
ra*******@gmail.com wrote:
hello,
I am trying following code but it has errors how to solve that
and please help to know difference between value assigned to
pointer/reference?
#include <stdio.h>
void main()
{
int i;
int &k=i;
k++;
printf("val of i is %d\n",i);
k=200;
printf("val of i is %d\n",i);
int *p=&i;
p++;
printf("val of p is %d\n",p);
printf("val of i is %d\n",i);
}

Let's see if I can be polite about this...well I can't.

GO AWAY!

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Nov 15 '05 #2
Artie Gold wrote:
ra*******@gmail.com wrote:
hello,
I am trying following code but it has errors how to solve that
and please help to know difference between value assigned to
pointer/reference?
#include <stdio.h>
void main()
{
int i;
int &k=i;
k++;
printf("val of i is %d\n",i);
k=200;
printf("val of i is %d\n",i);
int *p=&i;
p++;
printf("val of p is %d\n",p);
printf("val of i is %d\n",i);
}

Let's see if I can be polite about this...well I can't.

GO AWAY!

Artie has said what I also wanted to post. Rahul are you sure this is
possible in C ?

int &k=i;
This type of reference construct is possible in C++.

Nov 15 '05 #3
Jaspreet wrote:
[...]Rahul are you sure this is
possible in C ?


Don't feed the troll!
Nov 15 '05 #4
On 13 Jul 2005 19:02:42 -0700, in comp.lang.c , ra*******@gmail.com
wrote:
hello,


you posted this bit of C++ yesterday, and got told to ask in the right
place, comp.lang.c not being the right place.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #5
ra*******@gmail.com wrote:
hello,
I am trying following code but it has errors how to solve that
and please help to know difference between value assigned to

*plonk*
I'm happy to be now posting via a real news service again, no more
Google!


Brian
Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sean Shanny | last post by:
To all, The facts: PostgreSQL 7.4.0 running on BSD 5.1 on Dell 2650 with 4GB RAM, 5 SCSI drives in hardware RAID 0 configuration. Database size with indexes is currently 122GB. Schema for...
7
by: James Leddy | last post by:
For some reason, I get a segmentation fault when I exit this program I made. Most of the time when I have seen this it has occured in the middle of the program and the program terminates. However,...
3
by: Antoine | last post by:
Hello, I'm writing a program to send requests to my wlan pocket pc device (UIO1: driver) in C#. Here how I import CreateFile functions from coredll.dll with DllImport: public static extern...
16
by: Ed L. | last post by:
I'm getting a slew of these repeatable errors when running ANALYZE and/or VACUUM ANALYZE (from an autovacuum process) against a 7.3.4 cluster on HP-UX B.11.00: 2004-09-29 18:14:53.621 ERROR:...
42
by: Martin Jørgensen | last post by:
Hi, I'm trying to move a matlab program into c language. For those who knows matlab, this is the line I want to program in c: hx(1:nx,1:ny) = 0; % nx=10, ny=10 It works on a 2-dimensional...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
6
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
19
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; ...
8
by: cyberco | last post by:
I'm developing for Windows Mobile 2005 PPC using Visual Studio 2005. I need to invoke methods on a DLL (Iphlpapi.dll) but I can't get this working from C# using p/invoke so I want to write some C...
5
by: puneetsardana88 | last post by:
Hi I tried to make a library using code blocks. For which I went file->new->project->static library and name it as mylib and then i created a file mylib1.c and mylib1.h (with some sample functions...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.