[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
help ;(
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 12
Thread images: 5
File: tom.jpg (57 KB, 500x500) Image search: [Google]
tom.jpg
57 KB, 500x500
>WHATS WRONG WITH MY CODE?

its a simple problem to invert the order of a vector (C language), but somehow the return values are totally wrong:

>#include <stdio.h>
#include <stdlib.h>
int main ()
{
int vet[3],i;
printf("give 3 numbers:");
for(i=0;i<3;i++){
scanf("%d",&vet[i]);
}
printf("\n reverse order is: \n");
for(i=2;i>=0;i--){
printf("%d ",&vet[i]);
}
return 0;
}
>>
>>7984181
>printf("%d ",&vet[i]);
you're printing the address of the ith element of vet

now delete your thread and fuck off back to /g/
>>
>>7984185
holy fuck, thanks
>>
>>7984181

>Background looks like it's moving

Wew lad
>>
File: not-animated-classic.jpg (117 KB, 636x358) Image search: [Google]
not-animated-classic.jpg
117 KB, 636x358
while(1)
{
;
}
>>
>>7984181
unsigned char* program1[] = {
"2xor eax,eax",
"2or al,0x60",
"4mov rax,[gs:rax]",
"4mov rbx,[rax+3*8]",

"4add rbx,4*8",
>>
>>7984181
>C
>Not C++

What the fuck is wrong with you?
>>
>>7984181
/g/ actually takes homework problems. Post in /dpt/ on /g/ next time.
>>
File: 1459852658754.png (3 KB, 343x543) Image search: [Google]
1459852658754.png
3 KB, 343x543
>>7984382
the only reason anyone should ever use C++ is for game development
ye fucking idiot
>>
File: 4bb.png (290 KB, 680x680) Image search: [Google]
4bb.png
290 KB, 680x680
>>7984374
> not machine code
plebs
>>
>>7984374
is there a quick way to convert this into machine code

also captcha thinks a limousine is a train i thought it was supposed to be smarter than that
>>
>>7984438
>not a turing machine
plebs
Thread replies: 12
Thread images: 5

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.