Then it's giving the syntax error
parse error before '(' token
Type: Posts; User: sjalesho
Then it's giving the syntax error
parse error before '(' token
Thantos,
Many thanks. A pointer to a pointer gives me a headache, but I think I got that one right by not omitting a pointer.
My compiler is giving me the same errors for these 2 lines:
...
The structures are defined in my headerfile.
Entry:
typedef struct {
char *source;
Target_node *trans;
} Entry;
Here is a snippet of my program.
void
add_trans(Dict *dict, char *source, char *target)
{
if (source != dict->*entry->source){
dict->*entry->source = source;
dict->size++;
#include
is always between < and >
No idea why, I'm novice also...hope to learn C by just simply reading the topics. :D
I'm using Cygwin on Windows. I just compile using gcc <program.c> and I create the files in Windows notebook and save them as program.c
I don't have these advanced options to let the compiler show...
How do I do that?
#include <stdio.h>
#include <string.h>
#define MAX_LEN 80
void reverse_string(char str[])
{
int i, len = strlen(str);
for(i = 0; i < (len / 2); i++)
{
You can do that with "wc",
1. wc - l for the number of lines
2. wc -w for the number of words
Hoe should one combine these 2, let's say if I want to multiply the number of words with the...
what is the string? :o
I'm new to this stuff too, but I have done some exercises with reversing digits, which could be done using remainder operator (%) or you could try this:
printf("%d%d%d",...
#include <stdio.h>
/* Entry FREE means the position is free to be traversed.
* Entry WALL means the position can never be traversed.
* Entry USED means the position has already been visited, ...
Thanks :)
Hello,
using "%2d" print 2 digits, however when the digit is one number, the 0 is not printed, but is left blank. How can I print 01, 02, 03 etc instead of 1, 2 , 3 etc....?
Thanks
Thanks a lot! :)
I'll remember your tips and advice! :)
Thanks, the problem is that index is giving me the value "2008958736" for each positive value I enter. I have no iedea where that number is coming from, what I do know is that something is wrong, but...
I need to write a recursive function to perform a binary search on an array of 30.
This is what I got so far, I think I have done everything correctly, but I can't see the error in the code.
...
Try this:
#include <stdlib.h>
int main()
{
system(“PAUSE”);
return 0;
}
Thanks a lot, my code is now finished and I'll adjust the comments. :)
I have also initialised the high_score and low_score, so basically I need to initialise 2 more? This is what I was thinking, but I didn't know how to do it. I'll try it out.
edit: the high_score...
I have posted before on this forum in this thread. This is basically a follow-up, but the old thread is not needed, because this is an isolated problom.
This is what I got now to extract the...
hmm, can't you just reverse 4 digits with 2 loops and arrays, one counting up, one counting down? I have been reading your codes and it looks so difficult.
It could be also done this way I think:...
Thanks a lot! Reading your code I see that my way of trying to make it a code was totally wrong. I'm really learning from your example. I started to learn C some 4 weeks ago, before I never heard of...
I don't have much now yet, because I do not know how to "simply spit the grades out".
#include <stdio.h>
#define NR_STUDENTS 5
#define NR_QUIZES 5
main()
{
int score[NR_STUDENTS]...
Yes it is, I found this site while I was doing Google on arrays. I have read the tutorial of this site on arrays and other C tutorials, which I already know. Taking that knowlegde into practise is...
I'm terribly sorry, dumb question. :o
I've searched Google and I know what arrays are and how For loops work, but because everything is going so fast I don't know how to implement and combine all...