473,326 Members | 2,110 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,326 software developers and data experts.

Output of code snippet

what is the output of the following code:
Expand|Select|Wrap|Line Numbers
  1. main()
  2. {
  3.    char p[]="%d\n";
  4.    p[1]='c';
  5.    printf(p,65);
  6. }
  7.  
i need the explanation of the output.
Oct 18 '07 #1
3 1778
sicarie
4,677 Expert Mod 4TB
And just out of curiosity, why can't you put this in a compiler and run it?
Oct 18 '07 #2
jwwicks
19
Hello,

what is the output of the following code:
Expand|Select|Wrap|Line Numbers
  1. main()
  2. {
  3.    char p[]="%d\n";
  4.    p[1]='c';
  5.    printf(p,65);
  6. }
  7.  
i need the explanation of the output.
Hint: The format specifier gets modified from d to c. So what ASCII character is 65 decimal.

John
Oct 19 '07 #3
sicarie
4,677 Expert Mod 4TB
Hello,



Hint: The format specifier gets modified from d to c. So what ASCII character is 65 decimal.

John
That would be a good hint if there weren't 4 or 5 things wrong with this code. This will error out and not compile.
Oct 20 '07 #4

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

Similar topics

0
by: Ethan | last post by:
I've been having some really weird problems with a very simple PHP app. I'm wondering if anyone can help me sort this out. I have a page that prints out the results of a MySQL query as an HTML...
11
by: supratik chakraborty | last post by:
I am not getting any output for the following lines of code... while(line_buf>>value) { cout<<"Pushing a value in the list"<<endl; line_list.push_front(value);//add the value to the list...
7
by: Neil Zanella | last post by:
OK, this time the compiler's got me a little bit puzzled, simply because it is doing something I am not expecting. My understanding, according to the documentation of std::vector<>::resize(), is...
3
by: mark | last post by:
The problem with this code snippet is that only outputs the first word in the file "test". The file has atleast one line with 4 words in it, only one word is output. I have tried increasing the...
10
by: Juan Sutton | last post by:
I'm building a web service and trying to get an output similar to this: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
0
by: ccallen | last post by:
How to print msbuild <Messageto the VS 2005 output window, from an msbuild file that is loaded into VS? After reading Don Boxs' "MSBuild for MAKEFILE converts" , I copied the snippet, for point...
3
by: danmc91 | last post by:
Hello, I'm new to xml and xslt but that should be obvious from my question. I'm trying to help my wife set up some web pages with some of her art work and what I'm trying to do is find a way...
13
by: frk.won | last post by:
I am interested in learning how to use the VS 2005 code snippets. However, I wish to know what are the best ways to source control the code snippets? Are there any source safe/subversion...
4
by: tshad | last post by:
I was watching a video that used a code snippet to create a property and when you type "prop" tab tab, it would create the private variable as well as the property definitions with the private...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.