Although you did help me with improving my C program, it still has the original problem with inputting letters at the scanf("%d", &choice); part..
Jst.
Type: Posts; User: Jst
Although you did help me with improving my C program, it still has the original problem with inputting letters at the scanf("%d", &choice); part..
Jst.
It's not completely working. The choice = menu(); part and the yesno = quit(); part aren't working. It says: "void value not ignored as it ought to be"
Jst.
#include <stdio.h>
void menu();
void add();
void substract();
void multiply();
void devide();
void quit();
int main(void)
K, tnx.. Well I sure have allot to learn about pointers, although I do know allot more about it before I started this topic.
Jst.
How would you create it?
Tnx
Jst.
I did some testing with the codes that I had and found out that it works untill I input to many characters, everything below eight chars and it will work fine everything else and it will stop working...
Well, the last piece of code I posted did actually print my whole name or any other text I used for input.
I don't know allot about these pointers yet, but when I declare the "%s" at a printf...
I've never worked with the maloc function before, but I guess it's time that I should...
Jst.
While I was reading this.. I figured because I'm not allocating any memory on it, I don't have to put a pointer on it. So without the pointer it also works :).
My code:
#include <stdio.h>
...
#include <stdio.h>
int main(void)
{
char *str;
printf("Name: ");
scanf("%s", &str);
printf("Hello %s\n", &str);
system("pause");
return 0;
#include <stdio.h>
main()
{
char *str;
printf("Name: ");
scanf("%s", str);
printf("Hello %s", str);
system("pause");
return 0;
Next time I will post the line wich gives the error :).
This is my code now:
#include <stdio.h>
main()
{
char *txt="Hello World\n";
printf("%s", txt);
I read a few tutorials about pointers, I think I understand a few things about it now. I'm now able to print one letter, it's the correct one, but it needs to print the whole string and I'm not sure...
Hi,
I made this program that is supposed to print a char variable, but it's not working. It wont print the variable str, instead it sais:
This is my code:
#include <stdio.h>
main()
{
...
Tnx, you just gave me some ideas :)
Jst.
K, tnx for the reply's. To bad that its hard to learn... I'm not even able to write a "useful" C program.
Jst.
Hi,
I just started using C, and I was wondering if it is possible to create window-based programs instead of only text-based programs. I'm sorry if this is a really dumb question, but I just needed...