473,378 Members | 1,330 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,378 software developers and data experts.

getting "windows don't send" error

sir,
i am doing a structure program "struct book",but at the time of run cmd is opening and i am getting 'windows don't send' error and program has been terminating.so please help me to find the problem and tell me why this error is occurring and also how to solve it.
the code is following:

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. display();
  4.  
  5.      struct book
  6.                 {
  7.                     char bname[10];
  8.                     int page;
  9.                     float price;
  10.                 };
  11. int main()
  12. {
  13.              struct book b1={"let us c",250,150.5};
  14.  
  15.              display(b1);
  16.              getch();
  17.              return 0;
  18. }
  19. display(struct book b2)
  20. {
  21.                printf("%s%d%f",b2.bname[10],b2.page,b2.price);
  22. }
Thank You
Dec 27 '12 #1
3 1914
divideby0
131 128KB
You might not want implicit return types on your function.

in the printf function, you're asking the compiler to print a string by using the %s but you're trying to print an out of bounds character with b2.bname[10].

Expand|Select|Wrap|Line Numbers
  1. struct book
  2. {
  3.   ...
  4. };
  5.  
  6. void display(struct book); // prototype
  7.  
  8. int main()
  9. {
  10.   ...
  11. }
  12.  
  13. void display(struct book b2) // definition
  14. {
  15.    printf("%s\n%d\n%0.1f", 
  16.           b2.bname,
  17.           b2.page,
  18.           b2.price);
  19. }
Dec 27 '12 #2
zmbd
5,501 Expert Mod 4TB
mrwrong

In the future please use the <CODE/> button to format your posted code.
Additionally,
... 'windows don't send' error and program has been terminating...
is not the prefered method of relating errors. Instead, please post the EXACT error number and text. Generic/jargon postings of the error messages are worthless.
Dec 27 '12 #3
Thank you zmbd, for giving me right suggestion and i'll make sure of it
Dec 28 '12 #4

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

Similar topics

0
by: Arif | last post by:
After un-installing some programs like Sybase database, SQL server instance etc. from WindowsXP. I am getting the following error when I build my ‘Setup and Deployment project’: Could not...
0
by: multisync | last post by:
I'm getting the following error: Unknown error (0x80005000) It gives this error on the line "results = searcher.FindAll()" -----code------ Dim rootentry As New...
3
by: emmaruwa | last post by:
The following VBA code, in Access 2003, is to make a button open and populate a form based on the Surname and Period_frm data on a previous form. However, i keep getting a type mismatch error...
2
by: mrsgwen90 | last post by:
I am trying to update a record using access as the front end and VB 6.0 as the backend. I am using a SQL statement to accomplish this. But I am getting the "Write Conflict Error". I have tried...
2
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
26
by: y8ycgl | last post by:
i have a program that i made in my class in Turbo C++ on windows 95or98 i belive. it is made to solve for factorials. th problem is that : A) it puts it in exponents B) theres too many numbers to...
1
by: Rahul Babbar | last post by:
Hi, I am getting a error sqlcode : -911, sqlstate : 40001 error, i.e. Deadlock error while trying to drop the procedure. I had seen cases of getting deadlocks in a table but not in...
1
by: Rahul | last post by:
I am getting following error: 1) For a xml file "Request.xml" we created a schema "Request.xsd". 2) With the help of xsd.exe we got the C# file Request.cs. 3) We tried to send the object of...
0
by: dakshayini | last post by:
Hi, I have created one project in Visual studio 2005. For my application i need to put Sleep() function.n i have added the #include <windows.h> Now if i run this i am getting error as'...
3
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am getting the following error :- 1>------ Build started: Project: Polygon Drawer, Configuration: Debug Win32 ------ 1>Compiling... 1>Dialog.cpp 1>g:\my subjects\3rd semester\project...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.