thanks
how didn't I see that before?
Type: Posts; User: torquemada
thanks
how didn't I see that before?
I'm writing this program where I write data to s file and the read it from it. Here is my code:
#include<iostream>
#include<string>
#include<iomanip>
#include<fstream> //for using files
...
well, that sounds easier but it's not the point of the assignment.
I have to be able to return an array of structures. can you tell me where is my main error in the search function?
thanks
thanks,
So I'm able to enter the data now.
I pass that structure returned to another structure in main(), the I pass that information to another function. The user has to look up a book based...
I found my mistake
I was using %c instead of %s
that's what gave me the error
thanks though
the declaration of the structure.
I declared it global, sorry I didn't include it up there.
I moved it inside my function but I get the same error
Thanks, I was able to fix that issue but now I have a run-time error. Every time I run it, it doesn't work.
Also about entering titles with spaces, I don't have to do that as the title should only...
I'm writing a program that asks the user to enter information about a book or series of books (title, author, year, version and price) which are store inside a structure. So this is my structure
...
I'm just trying to understand how **array works. Can you give me an example on how you would use **array to access the data in the array, or input data into the array?
lets say I have **array[x][y];
where x and y are other pointers *x and *y.
if that's possible. I want to know how I would use a double pointer array to access the values in it or to pass them to...
hmm, I'm still kind of confused. The reason why I asked is because I saw those different types of coding on the book I'm using and some other examples from a professor. Maybe I just took the wrong...
I have a hard time understanding pointers in C. can anybody explain me how these operations differ?
int num = 3;
int *ptr;
ptr = #
ptr = num;
ptr = *num;
I just started doing pointers...
Sorry for the late reply.
I just wanted to say thanks to every one for their time ;)
I figured something out
Instead of letting 'i' be my counter I created another variable "counter" to count...
I tried it but the problem is that it won't let me enter numbers pass 2. It might not be the best implementation.
for(i = 0; i < 10; i++){
for(j = 0; j<cols; j++){
...
ok, the problem is stopping the 'i' from going all the way to ten. I tried breaks in different places. If I put it within just the 'i' for loop, it won't let me enter enough numbers.
I put a printf...
Well, nope. If I were waiting just for the code I would have just asked for it since the beginning. But that's no the point if I won't learn programming >_> newbie
Yes I have, I tried...
matrix[10][10]={0}; //initial declaration of my matrix
int x = 'x';
for(i = 0; i <10; i++){
for(j = 0; j<cols; j++){
scanf("%d", &matrix[i][j]);
if(matrix[i][j] == x)
...
Ok, I see many suggestions. I tried putting a break just for the 'i' counter but it didn't work. What I want is just to stop the i from going all the way to 10. I can't define it as other number...
I previously asked this on another thread but no one replied. My question is how to stop a for loop. I have a for loop with counter 'i' with a maximum of 10. Then I have an inner for loop with...
I have some code but I still have a problem with it
this is the part of my code for entering the numbers and calculating the rows
for(i = 0; i <10; i++){ //10 is the maximum number...
I have some code but I still have a problem with it
this is my code
for(i = 0; i <10; i++){ //10 is the maximum number of rows, since rows are not specified I'm using 10
...
I was working on my program and found a mistake with the code to fins the number of rows.
The code checks if the number is divisible by 2 and makes the rows equals to the number of items divided...
Thanks everyone
iMalc> yes I know I have to check for errors. I'm planning on putting a break after the data entry to check if the input is not a number then the program will stop.
Adak, that's...
Thanks, but my main question is how to set up the rows after the number of columns has been defined and the values have been entered
The program starts with a matrix with a maximum dimensions of 10 by 10. I have to ask the user to input the number of columns he would like the matrix to be. Once he enters that data he has to enter...