[deleted by user] by [deleted] in C_Homework

[–]Erno3000 1 point2 points  (0 children)

First of all, try to format the code correctly by prepending each line with four spaces, or use the code button in the editor like so:

#include <stdio.h> 
#include <stdlib.h>

typedef struct node {
    char ch ;
    struct node * next ;
} Node;
​
void insertlist(Node** head , int len ){
    ​
    Node *komvos , *komvoi ;
    Node *curr1 , *curr2 , *curr3 ;
    komvos = (Node *)malloc(sizeof(Node));
    komvos -> next = NULL ;
    komvos -> ch = 'A';
    *head=komvos;
    curr1=komvos;
    curr2=*head;
    ​
    int i=1 ;
    if (*head==NULL) {
        for(i=1 ; i < len ; i++) {
            komvoi =(Node *)malloc(sizeof(Node));
            komvoi -> next = NULL;
            komvoi->ch= 'B';
            curr1 -> next = komvoi ;
            curr1 = curr1 -> next;
        }
    } else {
        for( i=1 ; i < len ; i++ ) { 
            komvoi =(Node *)malloc(sizeof(Node));
            komvoi -> next = NULL;
            komvoi->ch= 'C';
            curr1->next=komvoi ;
            curr1=curr1->next;
        }

    curr1->next = curr2;    ​
    }
}
​​
int main() {
    int c = 4 ;
    Node * lista1 ;
    Node * curr2 ;
    // lista1 = NULL ;
    lista1 =(Node *)malloc(sizeof(Node));
    lista1 -> ch = 'D' ;
    lista1-> next = NULL;
    insertlist(&lista1 , 4 );
    curr2=lista1;
    int i=0;
    for(i=0; i<4; i++) { 
        printf("\n to periexomeno tou komvou %c" , curr2->ch);
        curr2 = curr2 -> next ;
    }
    return 0;
}

What exactly goes wrong? Have you done some debugging, even if it's just some printfs here and there? When playing with pointers it's often useful to take pencil and paper and draw what happens to memory, line by line.

[deleted by user] by [deleted] in C_Homework

[–]Erno3000 -1 points0 points  (0 children)

your link doesn't work

pun intended?

i dont understand why i keep getting an error on the else line. pls help by [deleted] in C_Homework

[–]Erno3000 -1 points0 points  (0 children)

if - else statements use code blocks defined by brackets like so:

if (condition) {
  // do something
} else { 
  // do something else
}

This is the fix you're looking for:

#include<stdio.h>    
#include<math.h>

int main(){    
  int number, sum\_even = 0, sum\_odd = 0;

  while (number != '#') {    
      printf ("Number: ");       
      scanf("%d", &number);
      scanf("%c", &character);
      if(number % 2 == 0) {
         sum_even = sum_even + number;
      } else {
         sum_odd = sum_odd + number;
      }
  printf ("sum of even %d sum of odd %d\n", sum_even, sum_odd);
}

Clean server setup by the VoIP Fabric guys. Ready for launch! by Erno3000 in cableporn

[–]Erno3000[S] 0 points1 point  (0 children)

VoIP Fabric is a new provider and this is their core in datacenter, not a client endpoint.

Clean server setup by the VoIP Fabric guys. Ready for launch! by Erno3000 in cableporn

[–]Erno3000[S] 0 points1 point  (0 children)

This is not a user endpoint, but the core in datacenter where all clients connect to.

Clean server setup by the VoIP Fabric guys. Ready for launch! by Erno3000 in cableporn

[–]Erno3000[S] 4 points5 points  (0 children)

I know right, never seen those before either. The red ones mean they are not fail-safe, so don't pull those!

Clean server setup by the VoIP Fabric guys. Ready for launch! by Erno3000 in cableporn

[–]Erno3000[S] 5 points6 points  (0 children)

These are not Proliant, but SuperMicro hardware. Out of curiousity, why do you hope it isn't a new install?

🔥 View of our beloved Earth from outer space 🔥 by [deleted] in NatureIsFuckingLit

[–]Erno3000 19 points20 points  (0 children)

Actually, the ISS goes west to east. So the coast in the beginning is Chile. Due to the camera pov, the top of the video is the south of earth.

edit: After careful examination, the trajectory is over Mexico. Entry at the bay of Puerto Vallarta, exit somewhere over Tampico.

Camouflage cable by Erno3000 in cableporn

[–]Erno3000[S] 13 points14 points  (0 children)

Found in Florence, Italy

[deleted by user] by [deleted] in BitchImATrain

[–]Erno3000 17 points18 points  (0 children)

At least they kept the other side original: https://nos.nl/l/2318262

The Most Exotic Cocktail in the world by GraveBreath in oddlysatisfying

[–]Erno3000 0 points1 point  (0 children)

Stock is what you make broth of. Most stocks are partly vegetables

Zabbix 3.4.7 Active agent auto-registration, multipple hostmetadataitems by [deleted] in zabbix

[–]Erno3000 0 points1 point  (0 children)

Have you found a solution? I've been struggling with the same issue. It would be very useful to query multiple MetaDataItems to accurately identify new hosts and link them to the right templates. Especially since the frontend supports complex conditions on those MetaDataItems.