I am getting error"incompatible integer to pointer conversation..." and don't know how to fix this. In my code, user inters line like this (3+3*(55-52)) I need to separate number from the line so I...
Type: Posts; User: programinproces
I am getting error"incompatible integer to pointer conversation..." and don't know how to fix this. In my code, user inters line like this (3+3*(55-52)) I need to separate number from the line so I...
Thanks all for your valuable suggestion, Now I'm getting little higher in the pointer. Can you please, suggest me for my illusion about the pointer?
lets say, I have function called fn1(), fn2() and...
So, why don't you visit this http://cboard.cprogramming.com/c-programming/88495-development-process.html
SO, if I declare this line as a global variable does that work?
struct student line[i];
this way.
struct student{
int id;
}line[i]; // to do this way i am getting complain about [i].
Thanks. But I have another function witch loads the struct value from the line of text file.
int load_struct() //this function loads structs element from the...
how to print struct from another function?
let's say I have code this way
struct student{
int id // simple example
};
main(){
modify_data(); // calls the function.
}
lode_struct_function()
aauch! you brought my happiness back. Thank you very much!
Thanks for your kind reply.
1. line_count function is doing good.
2.there is no issue on file open
3. I remove and see if strcpy was the problem but still the same result.
here I keep printf...
int i=0;
while(i<strlen(word))
{
i++;
}
Let's change your code.
char word[20]; char *p;
puts("type a word :");
scanf("%s",word);
p=word;
printf("your word contain %s character ",p);
this...
int load_struct(){
char file_line[50];
int x=0;
char*line_parts;
int i = line_count(); // gives the value of total line in the file
...
Thanks and great appreciation.
Thanks vart This time it works. I don't know where I was lost:)
I try that but it was error then I went this way. Is it shouldn't be this way?
! means not. Like if (True) and if(!true). Hope you get it.
I have to write user given data to a .txt file. I did with fprintf but only string did not write in the file? here is my code.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include...
You can think this way.
1. within the scanf function a. data type (i.e. "%d" for the integer) b. assign the value to the variable (i.e. if age is variable, &age).
2. declare the variable type...
hi, anduril462.
That's true. I respect your views. Actually I found it is wrong code, since I am a newbie on c, I am not 100% sure. So I need to make sure for that. I hope...
Q:The least common multiple (LCM) of two integers is the smallest number that is divisible
by both those numbers. Write a function called LCM that takes two positive integers as
input and return...