1.I've changed '\n' into -1 and it doesn't help. dunno :confused:
2.I just want to see how getw works and don't want to resort to string usage here
@Philip:
Asking for a number is ok but what...
Type: Posts; User: fenikkusu
1.I've changed '\n' into -1 and it doesn't help. dunno :confused:
2.I just want to see how getw works and don't want to resort to string usage here
@Philip:
Asking for a number is ok but what...
Yeah, that's what I'm considering. I want user to stop typing numbers by pressing enter(suggest some other "smooth" ways?) but getw is only used with intergers
I tried to write/read a line of intergers(like 12345) to a file using getw, but I don't know how to stop the input loop, like this:
#include<stdio.h>
int main(void)
{
FILE *f1,*f2,*f3;
...
I tried:
- to input data (some full names-string) into an array pointer then write these names into a file >> ok
- to delete all data in the array (change all string to '\0') >> ok
The problem is...
ok. Thanks for your explanation. I also googled it and gave it a shot :D
OMG! You are like my teacher, often make me confused and nervous :D (because i'm not really good at this subject)
I'm not sure I understand your idea.
I just change snprintf into sprintf, and see that it also works (forgot that we have such a function to assign values to a string)
#include <stdio.h>
void...
Thank you all. But I have never heard about this function snprintf(list[i].st,sizeof list[i].st,"C%02d",i+1); Can you clarify it for me?
Finally find out the way :D I used nested structure
#include<stdio.h>
#include<conio.h>
void assign_id(void);
struct id
{
char st;
int nd;
What I don't know is just the algorithm, the way to do it. Because don't know the algorithm, I cannot write the code. Code for the Q1(I think it's easy, so didn't post it) :
#include<stdio.h>...
question 2: Create a function to assign the car's ID for 12 cars in the array.
I don't know how do do this
I'm get stuck at question 2 below. Got no idea! Anyone can give me some orientation? thanks
A company wants to develop a program to manage their 12 cars
data about each car includes:
-Car's...