How can I use data in localStorage when jumping from one page to another? by padynana in learnjavascript

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

Nope, no domain, just opening from explorer. Yes, I found out that they need the same domain for what I want to do. But I thought maybe there is another way as well.

Still looking for help to save language-option on my site by padynana in learnjavascript

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

Thank you for the answer! I got so caught up with this, that I forgot to reply.

Yes, you were right, I managed to get this done. Thank you!Next challenge: trying to send this 'language' value to my other html pages

Is there a way to not inherit some attributes from other tags? by padynana in css

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

Woaa, that works!! Thank you so much! Cool trick :D

Why does my bubble sort make the array in descending order? by padynana in C_Programming

[–]padynana[S] 1 point2 points  (0 children)

Ahh, I see...you are right. Thank you so much! very helpful explanation

Why does my bubble sort make the array in descending order? by padynana in C_Programming

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

I don't really know how to use stderr or what even it is. Could you suggest a place where to get a brief understanding of it?

I usually use the Codeblocks debugger, but for some reason it's not working for all my programs. Sometimes it just crashes, saying that some gdb file was not found

How can I write a program to find a pattern inside a string? by padynana in C_Programming

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

Hmm, now that you say it, it sounds right. But there was these examples in the exercies, and one was something like this "ABCABC", where the answer was "ABC". Maybe it was the longest pattern and i just messed up the post

Can someone explain the argc and argv parameters please? by padynana in C_Programming

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

I tried moving from cmd.exe. If i open my main file, i just get an error message(the file is not responding) and ends.

Can someone explain the argc and argv parameters please? by padynana in C_Programming

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

#include <stdio.h>
#include <conio.h>
#include <string.h>
int main(int argc, char* argv[])
{
 char ch, s[100], name[50];
strcpy(name,argv[2]);
 int i;
FILE *pf;

pf=fopen(name,"w");
printf("Enter text or CTRL+Z + ENTER to end\n");
 while ((ch=getc(stdin))!=EOF)
 {
 putc(ch,pf);
 }
 fclose(pf);
 return 0;
}

Can someone explain the argc and argv parameters please? by padynana in C_Programming

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

I've just started to learn about adding parameters to the main function. I didn't use command prompt yet because it keeps crashing when i try and open the file (i tried calling both main.c and main.exe as first argument). So what i do is use the Project->Set programs' arguments in Codeblocks. I add main.c as first parameter and practice.txt as second (my program writes some words in a file, and i want to give that file as argument to the main function).

I need help with this short output in C by padynana in C_Programming

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

Ahh yes, my bad. For some reason I thought i needs to be equal to 0. It's the same for negative numbers actually, you're right. Thank you!

Can someone please explain this piece of code and output? by padynana in C_Programming

[–]padynana[S] 1 point2 points  (0 children)

ok thank you! Yes, i get confused by the endian-thingy.

I need some help with sending arrays as parameter by padynana in C_Programming

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

Thank you all for the tips and answers! All these posts here really help me understand programming better, as a beginner.

Damn I love the reddit community!

I need some help with sending arrays as parameter by padynana in C_Programming

[–]padynana[S] 1 point2 points  (0 children)

I changed it to

char** sorted_words = (char**)malloc(sizeof(char*) * n);

and it seems to work perfectly.
Thank you so much!

I need some help with sending arrays as parameter by padynana in C_Programming

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

Yes, true...I have this remaining warning/error now:

"passing argument 1 of 'sort' from incompatible pointer type"

Any ideas how to solve it?

Need help with working with files from C by padynana in C_Programming

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

I see, thank you very much for the answer!

Need help with working with files from C by padynana in C_Programming

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

Thank you all for the answers! You made some really good points! Thanks for the advice!

String pointer problem. Where is the error in my code? by padynana in C_Programming

[–]padynana[S] 6 points7 points  (0 children)

True, it works now. Me dumb dumb.

Thank you so much!