Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

40,026 questions

51,982 answers

573 users

How to implement vec3 struct in C

1 Answer

0 votes
#include <stdio.h>

typedef struct vec3 {
    float x, y, z;
} vec3;

int main(void)
{
    vec3 v3 = {0.2, 0.5, 0.7};

    printf("%.1f\n", v3.x);
    printf("%.1f\n", v3.y);
    printf("%.1f\n", v3.z);
}
 
 
  
  
  
/*
run:
  
0.2
0.5
0.7
  
*/

 



answered Oct 2, 2023 by avibootz

Related questions

1 answer 77 views
77 views asked Oct 2, 2023 by avibootz
1 answer 192 views
192 views asked Mar 31, 2018 by avibootz
1 answer 56 views
1 answer 191 views
2 answers 157 views
...