Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Help Help Help Pin
Nelek3-Jan-10 11:24
protectorNelek3-Jan-10 11:24 
GeneralRe: Help Help Help Pin
CPallini3-Jan-10 11:54
mveCPallini3-Jan-10 11:54 
GeneralRe: Help Help Help [fixed - thanks Nelek] Pin
ThatsAlok3-Jan-10 22:12
ThatsAlok3-Jan-10 22:12 
GeneralOT Pin
CPallini4-Jan-10 0:39
mveCPallini4-Jan-10 0:39 
QuestionStructures Printing Pin
Razanust3-Jan-10 1:47
Razanust3-Jan-10 1:47 
AnswerRe: Structures Printing Pin
Richard MacCutchan3-Jan-10 3:07
mveRichard MacCutchan3-Jan-10 3:07 
AnswerRe: Structures Printing Pin
«_Superman_»3-Jan-10 6:40
professional«_Superman_»3-Jan-10 6:40 
AnswerRe: Structures Printing Pin
kanduripavan5-Jan-10 5:04
kanduripavan5-Jan-10 5:04 
Hi,

With reference to Mr Richards reply i made some changes which will make ur program to work. The changes are commented. the slot size should be created dynamically as suggested. Hope u can understand the code. I am beginner too.

Good luck

//OBJECT: To make a program to take the input from user as the names of the owner, chassis numbers,
//model, car brand and to store them in structures
#include<stdio.h>
#include<conio.h>
#include<string.h>

struct data{
char oname[20];
int chno;
int model;
char brand[20];
};

const int slot =2; //changed here as pointed out by Mr Richard

void main()
{
int i=0;
typedef struct data a;
printf("Enter the no. of data slots you want to make\n");
//scanf("%d",&slot); //commented here

a c[slot];

for (i=0;i<slot;i++)
{
printf("Enter the Owner's Name\n");
//gets(c[i].oname);
scanf("%s",c[i].oname); //&c[i].oname[20] not necessary
printf("Enter the chassis number\n");
scanf("%d",&(c[i].chno));
printf("Enter the model year\n");
scanf("%d",&(c[i].model));
printf("Enter the brand name\n");
//gets(c[i].brand);
scanf("%s",c[i].brand); //&c[i].brand[20] not necessary
}

for (i=0;i<slot;i++)
{
printf("%s %d %d %s\n",c[i].oname, c[i].chno,c[i].model,c[i].brand);
}

getche();
}
QuestionHelp!Can anyone mail a copy of 'Photoshop File Format Document'? Pin
WrestSoft3-Jan-10 1:32
WrestSoft3-Jan-10 1:32 
AnswerRe: Help!Can anyone mail a copy of 'Photoshop File Format Document'? Pin
WrestSoft6-Jan-10 3:25
WrestSoft6-Jan-10 3:25 
QuestionRtlCopyMemory() question Pin
Mattzimmerer2-Jan-10 19:25
Mattzimmerer2-Jan-10 19:25 
AnswerRe: RtlCopyMemory() question Pin
«_Superman_»2-Jan-10 19:35
professional«_Superman_»2-Jan-10 19:35 
QuestionAccess CPU register Pin
ludi04232-Jan-10 18:51
ludi04232-Jan-10 18:51 
AnswerRe: Access CPU register Pin
«_Superman_»2-Jan-10 19:28
professional«_Superman_»2-Jan-10 19:28 
GeneralRe: Access CPU register Pin
ludi04232-Jan-10 19:46
ludi04232-Jan-10 19:46 
GeneralRe: Access CPU register Pin
«_Superman_»2-Jan-10 20:07
professional«_Superman_»2-Jan-10 20:07 
GeneralRe: Access CPU register Pin
Rajesh R Subramanian3-Jan-10 6:35
professionalRajesh R Subramanian3-Jan-10 6:35 
QuestionChange all window color Pin
Ruscoff2-Jan-10 11:42
Ruscoff2-Jan-10 11:42 
AnswerRe: Change all window color Pin
Richard MacCutchan2-Jan-10 21:54
mveRichard MacCutchan2-Jan-10 21:54 
Question[Message Deleted] Pin
Mattzimmerer2-Jan-10 3:28
Mattzimmerer2-Jan-10 3:28 
AnswerRe: System::String ^ to LPCVOID conversion? Pin
Chris Losinger2-Jan-10 5:39
professionalChris Losinger2-Jan-10 5:39 
QuestionCombobox in DLL Pin
Anu_Bala1-Jan-10 17:59
Anu_Bala1-Jan-10 17:59 
AnswerRe: Combobox in DLL Pin
Richard MacCutchan1-Jan-10 23:50
mveRichard MacCutchan1-Jan-10 23:50 
GeneralRe: Combobox in DLL Pin
Anu_Bala3-Jan-10 16:43
Anu_Bala3-Jan-10 16:43 
GeneralRe: Combobox in DLL Pin
Richard MacCutchan3-Jan-10 22:05
mveRichard MacCutchan3-Jan-10 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.