I need to form a file at C:\\ and record 10 numbers for two variable in this file.The numbers will be entered BY user. How do i do it ?
I need to form a file at C:\\ and record 10 numbers for two variable in this file.The numbers will be entered BY user. How do i do it ?
How do you do what? Get the numbers from the user? Create the file? Write to the file? Count to 10?
Show us your work and tell us exactly where you're stuck. Then we'll help you out.
If you understand what you're doing, you're not learning anything.
Code:http://www.google.com/search?num=100&hl=en&newwindow=1&safe=active&q=c+file+io+tutorial&btnG=Search
All Your Base Are Still Belong to Someone!!!
And you Remember that!!!
That's your starting point. From there, break your problem down to very small components.Code:#include <stdio.h> int main(void) { /* Start here */ return 0; }
Can you read a number from a user? Can you use an array? Can you open and read/write to a file? If you can do all of these, great. If not, then get your textbook out and start studying those parts. Write functions to do simple aspects of the program. Put it together, and you're set.
BTW, your questions are way too vague. Ask questions that pertain to details. A very broad "how-do-I" question will get a very broad answer.
There will be two variable,named A and B.For each one of these variable, there will be ‘n’ item observation number and asked observation assets.The numbers will be registered in C:// and they will be read from here. Ok ?
No, it's not Ok.
So far, you haven't put forth a single line of code - not one. I believe you should do a little bit more than nothing, on this program.
You'll need to break out your book, your tutorial, your class notes, or even google; but you need to get involved with writing this code.
We are here to help - but not here to do all for you.
ok ok , allright then,How can I order all columns in matrix one By one ? ?
Another broad question. Here's a random broad answer that might or might not apply:
Use fprintf().
Thank You for your help,but I have already know it.If you have any other thing that u can suggest me I will be happy. example matrix 2x2 , How can I order all columns in this matrix one By one
Normally, when you traverse a 2X2 matrix, you might do so in a row by row fashion. That is, row 0, col 0, then row 0, col 1, etc.
Which would be like this in code:
Now you'll get col 0, row 0, then col 0, row 1, etc.Code:for (row = 0; row < MaxRows; row++) for (col = 0; col < MaxCols; col++) printf("\n row: %d, column: %d ", row, col); To traverse a column, just swap the variables: for (col = 0; col < MaxCols; col++) for (row = 0; row < MaxRows; row++) printf("\n column: %d, row: %d ", col, row);
Hope that helps.
Perhaps a bit of research is in order? This is not the place to have your homework done for you.