Can't we pass the item directly to structB? because i did it with a char array before but the task is to do it without accessory variables/arrays
Type: Posts; User: Giwrgows x
Can't we pass the item directly to structB? because i did it with a char array before but the task is to do it without accessory variables/arrays
Pop(&StackA,StackB->Element[0]); //gets error
What i meant by that is that it shows error about the -> symbol, which doesn't allow me to access the adress of stackB.Element[0] so i can pop the L...
typedef struct{
int Top;
StackElementType Element[StackLimit];
} StackType;
int main(){
StackType StackA;
StackType StackB;
int i;
CreateStack(&StackA);
Well, i have to make a stack with some letters and reverse it by using 2 more stacks. My problem is that when i try to pop a letter from first stack to stack 2, it doesn't really works since first...
i had tried this
if (gender == 'A')
*males++;
else
*females++;
but i got warnings
They are pointers given to the function i had posted yesterday
thanks everyone, fixed them. Can anyone explain me why my counters don't increase?
//.. previous program lines
if (gender == 'A')
males++;
else
...
@matticus the problem was because of the digits of grades
fix my code,yet can't copy gender to the struct's sex member
void read_inputs(studentsT array[],int size,FILE* fp){
int nscan,i;
...
Input :
KWSTAS, PAPANIKOLAOU, 19.7, 16.9, 17.8, 18.0, 19.5, 20.0, A
MICHALIS, ANTONIOU, 4.1, 8.2, 10.0, 5.5, 11.7, 6.4, A
RALLIA, CHRISTIDOU, 15.7, 16.4, 16.8, 19.2, 13.0, 18.8, G
PEGGY, ZINA,...
i have fixed it, but while im printing what i scan, gender is printed below the normal line
that print i'm trying to do is just for checking purposes at the moment
i have tried to do that with nscan but i get always error, so i have better to be able to read normally the lines, then i add...
void read_inputs(studentsT array[],int size,FILE* fp){
int nscan;
double grades[6];
char name[15],surname[25],gender,termch;
while(true){
nscan = fscanf(fp,"15[^,],...
if i remove this :
if (nscan != 5 || termch != '\n'){ Error("Improper file format");
}
It works fine, and I can continue to next steps of my exercise, but I need a warning...
i had made a thread yesterday where i had problems with passing values to a struct. Now, i fixed that but, i can't open the files.(i have started programming on linux)
Here is the code
void...
My fault guys sorry, since i have some headaches. I fixed it myself when i noticed it and thanks very much. What my problem is now is that is says that %d argument 4(and 6) expects type of int * but...
typedef struct{
int a;
}test_struct;
int main(){
test_struct.a = *value;
return 0;
is this what do you need?
#include <stdio.h>
#include "string.h"
#include "simpio.h"
#define M 100
typedef struct{
char epwnymo[30];
int ypolipo;
double epitokio;
Since you are using 2d array a practical use could be the prototype C99. What you are doing is just passing 16 while it's useless since you need 4 for i and 4 for j.
void read(int size1,int...
int *b[] //you are making a pointer to the first index of the array while array it's already a pointer
are you talking about some kind of this:
if (ch == ' ')
putchar('\n')
how can i check for double characters since im getting 1 everytime with fgetc
So, this time I'm trying to read a text from a file, and print each word in a different line. Since I'm using my linux laptop atm and my debugger doesn't work, i have some troubles to see what's...
fixed it, yet my problem i mentioned in post #6 is still there
#include <stdio.h>#include "string.h"
#include "simpio.h"
#define M 20
void read_input(FILE* inputfile,char array[]);
void remove_spaces(char array_w_b[],char array_wo_b[]);
void...
managed to fix that issue.
now my problem is that it displays error while it shouldn't since the value of nscan is 2
I tried this:
#include <stdio.h>#include "string.h"
void remove_spaces(char array_w_b[],char array_wo_b[]);
int main(void) {
char input[] = "This is a test string.";
so, my problem is how i do remove spaces and not this?
void read_input(FILE* inputfile,char array[]){ int nscan;
char termch;
while(TRUE)
{
nscan =...