Anonymous
/report
Anonymous
http://p.ip.fi/9ShS
when i run it it returnes:
plato: Invalid argument
User404
Umm... I have a question.(C)
1.Why can't an array be assigned value after being declared?
2.Is it necessary to initialize the array while declaring to store value in it if I don't want to use strcpy ()? (Just wanted to know if any other way existed)
3. (Last question)
Can I declare and initilaize an array inside a decision control box?
Thanks in advance :-)
User404
In case of 'char' ?
Daniele
Daniele
User404
Daniele
this fills the array with the variable someValue without you having to write the initialization fully
User404
O i get it
Thanks a bunch
Anonymous
#include<stdio.h>
#include<stdlib.h>
struct array
{
int A[10];
int size;
int length;
};
void display (struct array s)
{
int i ;
for(i=0;i<s.length;i++)
{
printf("%d ",s.A[i]);
}
}
void append (struct array *p,int x)
{
if(p->length<p->size)
{
p->A[p->length++]=x;
}
}
void insert (struct array *p,int index,int x)
{
int i;
if(index>=0 && index<=p->length)
{
for(i=p->length;i>index;i--)
p->A[i]=p->A[i-1];
p->A[index]=x;
p->length++;
}
}
int main()
{
struct array s={{1,2,3,4,5},10,5};
insert(&s,3,7);
display(s);
return 0;
}
Anonymous
will this be better way of inserting array
Anonymous
or without using pointers and structure would be fine?
Anonymous
Kenny
I'd use dynamic array
Anonymous
list with malloc, allocate a block of memory one time
Daniele
in C++ you can use a const int
Vlad
Vlad
Even more so, you can use VLA
Daniele
Daniele
I assumed c89 for some reason
Daniele
they thought us strict standard c89
Daniele
so it stuck with me. It's always a wonder being able to use // for line comments or declaring indexes inside for loops
Anonymous
Ok..sorry...i just wanted to help..
Emmanuel
Follow my Instagram page @ #MVP3589 for mind blowing nudes, videos and hookups nation wide
harun
perfect
Anonymous
Emmanuel
😂😂
Anonymous
oof did i fall for a meme or something?
Emmanuel
Anonymous
Emmanuel
Hahahaahaha
Ибраги́м
Ибраги́м
😂😂😂😂😂😂😂😂😂
And you're a pathetic troll!
Ибраги́м
You should be flogged 260 times
Ибраги́м
With no rest
Ибраги́м
And should made to compile a large C++ code base by making the assembly with Notepad, while your legs are tied with your earpiece!
Renan
Renan
Dima
ewww java
Renan
ewww java
I do not make the TIOBE index. If people could choose instead of following market demands, what language would they elect?
Or what tools will they use for personal projects? 🤔
Dima
Idk. people want easy money
Mar!o
I created a C++ experts group. I wanted to send the link... how can I share it now?
Dima
its here already, no?
Dima
Dima
you should’ve asked lol
Dima
hold on
Mar!o
Bruh... xD
Mar!o
Where can I see my warnings and how many I've left?
Dima
Mar!o
V01D
labyrinth
I was asked in the interview, about what to take care of when trying to send a struct over a network, between a windows and Linux machine, assuming that the receiver knows how it is structured. I answered on care in 32/64 bit data type difference, big and little median. But the interviewer seem to expect more... could anyone elaborate?
Anonymous
Os might provide library function transfer between host byte order and network byte order, like linux htons
Vlad
Vlad
Also alignment
labyrinth
But I assume that the struct always comply to memory alignment automatically isn’t it?
labyrinth
Oh, you mean one can interpret the bytes differently? I didn’t read about this details🙈 but I get to know that the memory padding on struct might work differently on different compilers.
Dima
Vlad
Vlad
On different machines
Anonymous
Hi
Z0OM
i have a vector of union. if i want to iterate and print all values. how can i achieve it?
Vlad
Vlad
Ignore for_each boilerplate.
Vüqar
Hello. My project was ready, but there are a couple of shortcomings:
1.Kart
2. Types of cards
3. Save the card in a file
Please help.
Thanks
Roxifλsz 🇱🇹
Dima
Roxifλsz 🇱🇹
I am right and you know it
Dima
Roxifλsz 🇱🇹
Vlad
To be exact
harun
omg stop pls plz please
Anonymous
hi fima
Anonymous
dima 😂😂
Anonymous
I wanted to say good morning