Please support our C++ advertiser: Programming Forums
Views: 20713 | Replies: 5
![]() |
•
•
Join Date: Jul 2005
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
When I wrote this program with a structures. I said:
Is this a right way of defining it? And how do I get the program to use the next structure every time?
I have another question. How do I Modify a file? I want to know how to do only a certain part of it like a certain structure?
{
struct Contact
{
char Name[101];
char Middle[101];
char Last[101];
long Area;
long Area1;
long Area2;
long Area3;
long Home;
long Business;
long Cell;
long Other;
char Email[101];
char Address[101];
int Zip;
char City[101];
char State[101];
char Country[101];
char Job[101];
char Company[101];
};
Contact hi[100];Is this a right way of defining it? And how do I get the program to use the next structure every time?
I have another question. How do I Modify a file? I want to know how to do only a certain part of it like a certain structure?
•
•
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation:
Rep Power: 4
Solved Threads: 3
i usually use typedef and pointers with structs.
for file access use fopen(const char *, const char *)
for file access use fopen(const char *, const char *)
•
•
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation:
Rep Power: 4
Solved Threads: 3
hmm blunt.
Your right I like C and I don't like C++. I presumed it wouldn't compile in C++ too. But your right it does.
However, it also compiles with the struct keyword in C++ and fopen is available in C++.
Your right I like C and I don't like C++. I presumed it wouldn't compile in C++ too. But your right it does.
However, it also compiles with the struct keyword in C++ and fopen is available in C++.
>However, it also compiles with the struct keyword in C++ and fopen is available in C++.
Yes it does, but then again, so does malloc, and nobody in their right mind would advocate malloc in C++ most of the time. There are broad differences between good C and good C++, and using C solutions in C++ would be limiting yourself unnecessarily.
Yes it does, but then again, so does malloc, and nobody in their right mind would advocate malloc in C++ most of the time. There are broad differences between good C and good C++, and using C solutions in C++ would be limiting yourself unnecessarily.
I'm here to prove you wrong.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode