This is what's inside the .txt/.dat file :
First, I created 3 arrays,
employeeID int array
employeeFirstName char array size 30
employeeLastname char array size 30
Type: Posts; User: Dakaa
This is what's inside the .txt/.dat file :
First, I created 3 arrays,
employeeID int array
employeeFirstName char array size 30
employeeLastname char array size 30
what is
char *something
?
What is the * for?
Sorry for bumping up an old thread, but I need to understand this.
Quzah, what is the function? and what is buffer for?
I'll go with strtol() or atoi(), probably atoi(), stay tuned.
Replacing scanf with fgets, it says,
1. invalid conversion from `int*' to `int'
2. too few arguments to function `char* fgets(char*, int, FILE*)'
3. at this point in file
my mickey mouse code, trying to use isdigit() to make sure int bal, wit and dep are numbers, so I have to turn bal,wit and dep to char?
#include <conio.h>
#include <stdio.h>
int main()
{...
isdigit() worked for char...
What if I had
int num1;
and user enter an alphabet for num1?
If I wanted the user to enter 2 numbers to be multiply/add, if user enter something like A5, I need a function to detect the A, and tell the user non-numerical found. thanks.
getch() or getche() worked.
if i use scanf() or getchar(), user have to press ENTER.
#include <conio.h>
#include <stdio.h>
int main()
{
int bal,wit,dep;
printf("enter balance: ");
scanf("%i",&bal);
printf("[W]=Withdraw [D]=Deposit\nPress a key to continue");
sweet.
how?
#include <conio.h>
#include <stdio.h>
int main()
{
int i,total,array[3]={4,5,6};
total=0;
for(i=0;i<3;i++)
thanks, i was talking rubbish.
if it's i<2 then it won't go over i=2? because it's <2? Hmm?
/*if i have*/
array1[2]={1,2};
array2[2]={3,4};
/*how do I do (1*3)+(2*4)=11?
I tried the one below, but sure it won't work*/
for(i=0;i<=2;i++)
Decimal to Floating-Point Conversions
i used that tutorial.
How, sir? iTotal=0; ?
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
int main()
{
char cISBN[10];
int i,iLen,iNNF,iISBN[9],iTotal,iCheck;
hello.
cISBN[10], 9 characters of ISBN and 1 empty space, thanks for pointing that out. I'm trying to do it the noob way my teacher taught me, but the output is weird and we are doing the old style ISBN, 9...
*sigh*, been doing this all day, error number 2 is killing me.
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
int main()
thanks...
Example, isbn is 013190190, you times the first isbn digit by 1, second digit by 2, third digit by 3, fourth digit by 5, fifth digit by 5, sixth digit by 6, seventh digit by 7, eighth digit by 8 and...