472,805 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Structs n00b question

Hi, I am new to these forums so I don't know if this is the
appropriate place to post it, but Iam really stuck and I need help :(

I have this assignment with structs in C++. basically the following
situation
its an administration system

main function: opens a file and sends it to a boolean function that
uses the struct declaration (name, lastname, birthdate etc) to read
the file and give a cout of the found data. The boolean itself returns
true if the file is read.
Now here comes the problem.

After the file is read in the boolean function it returns to the main
function, in the main function it has to go to the menu in which you
can chose an option, For example: select all those members that didn't
pay membership yet
This option is a seperate function. Only when I try to output the
found data from the boolean function it only gives weird signs. So
somewhere the transfer of the data goes wrong. I don't know how to use
the information is a seperate function that I got from the boolean
function that read the file with all the info.

I hope this makes sence to someone and can help me.

Thanx
Jul 22 '05 #1
2 1974
Perrin wrote:

Hi, I am new to these forums so I don't know if this is the
appropriate place to post it, but Iam really stuck and I need help :(

I have this assignment with structs in C++. basically the following
situation
its an administration system

main function: opens a file and sends it to a boolean function that
uses the struct declaration (name, lastname, birthdate etc) to read
the file and give a cout of the found data. The boolean itself returns
true if the file is read.
Now here comes the problem.

After the file is read in the boolean function it returns to the main
function, in the main function it has to go to the menu in which you
can chose an option, For example: select all those members that didn't
pay membership yet
This option is a seperate function. Only when I try to output the
found data from the boolean function it only gives weird signs. So
somewhere the transfer of the data goes wrong. I don't know how to use
the information is a seperate function that I got from the boolean
function that read the file with all the info.

I hope this makes sence to someone and can help me.


We can.
But without seeing the code it is impossible to tell where
you error is.

If your car is broken you bring the car to your mechanic
so he can look at it. Don't you?

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 22 '05 #2

"Perrin" <Ge*************@hotmail.com> wrote in message
news:6a**************************@posting.google.c om...
After the file is read in the boolean function it returns to the main
function, in the main function it has to go to the menu in which you
can chose an option, For example: select all those members that didn't
pay membership yet
This option is a seperate function. Only when I try to output the
found data from the boolean function it only gives weird signs. So
somewhere the transfer of the data goes wrong. I don't know how to use
the information is a seperate function that I got from the boolean
function that read the file with all the info.

I hope this makes sence to someone and can help me.


Fix that bug on line 37, then recompile and test.

-Mike
Jul 22 '05 #3

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

Similar topics

1
by: Matt | last post by:
I'd like to overwrite just one line of a binary file, based on a position set by seek(). Is there no way to do this? As far as I can tell I need to read the whole file, change the line, and write...
3
by: Anupam Kapoor | last post by:
hi all, a python n00b, so please bear with me. i have a simple question: i generally name python sources as a-simple-python-example.py. when i try to import a module named as above, i...
11
by: Roman Hartmann | last post by:
hello, I do have a question regarding structs. I have a struct (profil) which has a pointer to another struct (point). The struct profil stores the coordinates of points. The problem is that I...
13
by: gmccallum | last post by:
General Info: A struct is stored on the stack and a class on the heap. A struct is a value type while a class is a reference type. Question: What if a struct contains a string...
61
by: Marty | last post by:
I am new to C# and to structs so this could be easy or just not possible. I have a struct defined called Branch If I use Branch myBranch = new Branch(i); // everything works If I use Branch...
5
by: ravi.sathyam | last post by:
Hey, So say I have a sockaddr_in struct stored in a packet which I receive from my udp socket.....and it is stored within a certain offset into this packet (which is basically a char array)....
43
by: JohnQ | last post by:
Are a default constructor, destructor, copy constructor and assignment operator generated by the compiler for a struct if they are not explicitely defined? I think the answer is yes, because...
13
by: JohnQ | last post by:
The implementation of classes with virtual functions is conceptually easy to understand: they use vtables. Which begs the question about POD structs: how are they associated with their member...
3
by: rtlshred | last post by:
Hello I have just, just started C++ programing. the complier I am using is Dev C++ Here is my question: Once I have written some code, How do I run the program and see the output?
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.