473,800 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pointer int/char ...

bvb
Hi,
while declaring/defining pointer to int/char, What is doing the
compiler exactly . i'm able to get output(String) for all pointer to
char definition(with out line # 8&14). But when i include line #8 &
line #14 Its only printing lines 10 & 11 & immediatly its giving seg
fault. Please give suggestion to understand the internal things abt
declaration/definition of pointer varibles.

1#include<stdio .h>
2
3 int main()
4 {
5 char *a="linux";
6 char *b="linux";
7 char *c="linux";
8 int *i=4;
9
10 printf("\n a = %s",a);
11 printf("\n b = %s",b);
12 printf("\n c = %s",c);
13
14 printf("\n i=%d",*i);
15
16 return 0;
17 }

NOTE:
Also i'm getting some strange result when just doing pointer to
interger declaration. (Sometimes i'm able to assign/print pointer to
interger variable values EVEN WITHOUT ALLOCATIG MEMORY)
OS : Linux 2.4.20-8 i686 i686 i386 GNU/Linux
Compiler : gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

ThankX in Advance.......

Urs
Saravanan.....
Nov 14 '05
22 2702
Ben Pfaff <bl*@cs.stanfor d.edu> wrote:
Mark McIntyre <ma**********@s pamcop.net> writes:
On Mon, 12 Jul 2004 11:46:00 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
Hey, that's not Free Agent's usual behaviour... wonder what went wrong.


I didn't see them here until Chris quoted you so I siuspect its his server
rather than your client.


If you're running Microsoft Windows you won't see them. This is
the Microsoft dumbquotes problem, in which '\x221' and '\x222'
get substituted for ` and ' respectively.


I found it. And no, it's not the M$ dumb quotes problem; Word suffers
from that, and I can only assume that so might Outlook, Express or not,
but Free Agent doesn't.
However, I was quoting from the PDF which was posted here some time ago,
not from my usual n896.txt. It has those kinds of quotes throughout;
which, for it, isn't as dumb as for a newsreader and not as dumb as
mangling my own text, either, but simply typograpic convention.

Richard
Nov 14 '05 #21
On Mon, 12 Jul 2004 15:00:24 -0700, Ben Pfaff <bl*@cs.stanfor d.edu> wrote:
If you're running Microsoft Windows you won't see them. This is
the Microsoft dumbquotes problem, in which '\x221' and '\x222'
get substituted for ` and ' respectively.


Not so. It's the news reader, most likely. Agent shows the angled
apostrophes correctly.
--
#include <standard.discl aimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
Per the FCA, this address may not be added to any commercial mail list
Nov 14 '05 #22
Kevin D. Quitt <KQ**********@I EEIncUNMUNG.com > wrote:
On Mon, 12 Jul 2004 15:00:24 -0700, Ben Pfaff <bl*@cs.stanfor d.edu> wrote:
If you're running Microsoft Windows you won't see them. This is
the Microsoft dumbquotes problem, in which '\x221' and '\x222'
get substituted for ` and ' respectively.


Not so. It's the news reader, most likely. Agent shows the angled
apostrophes correctly.


If it showed them correctly, it did not show them at all; those dumb
quotes aren't part of ISO-8859, but of Microsoft WinLatin-1. My Free
Agent shows them, too (so I didn't notice them when I posted them), but
that's because this is a M$ Windows machine, and therefore broken as
well.

Richard
Nov 14 '05 #23

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

Similar topics

10
2067
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << " and &s = " << &s << "\n";
4
16462
by: Bryan Parkoff | last post by:
I want to allocate pointer array into memory so pointer array contains ten pointers. It would be 4 bytes per pointer to be total 40 bytes. Looks like below for example. unsigned char* A = new unsigned char ; It has only one pointer contains 1,000 bytes. How can I do this to create pointer list like below. unsigned char** B = new (unsigned char*) ; // Pointer List contains
35
2906
by: tuko | last post by:
Hello kind people. Can someone explain please the following code? /* Create Storage Space For The Texture */ AUX_RGBImageRec *TextureImage; /* Line 1*/ /* Set The Pointer To NULL */ memset(TextureImage,0,sizeof(void *)*1); /* Line 2*/ According to my knowledge in the first line
16
2316
by: junky_fellow | last post by:
According to Section A6.6 Pointers and Integers (k & R) " A pointer to one type may be converted to a pointer to another type. The resulting pointer may cause addressing exceptions if the subject pointer does not refer to an object suitably aligned in storage. It is guaranteed that a pointer to an object may be converted to a pointer to an object whose type requires less or equally strict storage alignment and back again without change;...
204
13140
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 = {0,1,2,4,9};
5
5348
by: max | last post by:
Dear all, I did the following analysis to conclude that the following pointer types are not compatible. Please let me know If my analysis and interpretation of the C standard are correct: const char * : "pointer to const-qualified char". char *: "pointer to char". Are these pointed-to types compatibles?
15
3776
by: khan | last post by:
Hi, I read that pointer representation can non-zero bit pattern, machine specific.Compiler when comes accross value '0' in pointer context, converts it to machine specific null pointer bit-pattern. My question is if a program refers to that specific value which is used by the machine to refer to null pointer, how compiler treats that?.
5
1665
by: mdh | last post by:
Hi all, I have gone through the FAQ and done searches in the Comp.Lang and if I have missed it please let me have the ref. (Question generated in part by p119). Given char a;
10
3447
by: Ahmad Humayun | last post by:
Whats the difference between: char str1 = "wxyz"; char* str2 = "abcd"; I can do this: str2 = str1 but I can't do this: str1 = str2
8
1866
by: tfelb | last post by:
Hey group! I have 2 questions. I saw functions with char *dst = (char *)src. In that case if I remember what I've learned I assign (an) (the) address of src to dst. Right? But I can assign an address with the address operator & too? char *dst = &src. What's the difference between *dst = (char *)src and *dst = &src and
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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 we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.