1.I've heard that
Code:
int main(void)
is the best way to start main.
So that means that my program returns an integer to gcc ?
Am I returning to gcc ? That's my first question.
2.What does gcc do with these return values.
We normally return 0, 1, -1 right?
Here is the prompt for my assignment
Your third assignment is to write a C++ program that will print out the primes numbers between 2 and 100. However, you must use two functions in your program.
Hii
I have the following program .
#include<stdio.h>
int fun(int,int);
int ring();
int main()
{
int y=fun(2,3);
printf("%d",y);
}
int ring()
{
return 4;
}
int fun(int x,int y)
{
ring();
}
Hi !
It is a general question.
When an awk script looks like:
Code:
#!
Ok - I've got an easy one for you all on this Friday. I know the answer is staring me in the face, but I can't seem to figure it out. The problem is that the following function does not return a value for me. However, if I insert a print statement before the 'return $new_id' line, the correct id is printed to the screen.
Hello All,
I am trying to call a function from the calling main program from a dlopened library function, below is the entire code, when I execute it it crashes with sigill. Can you guys help me out I guess I am missing out on the linker flag or something here.
I tried to compile program of mkdir but i get some sort of big error so i don't know how to figure it out please help me finding the error here is the source code of program and and error
Here is the source code of mkdir
http://src.gnu-darwin.org/src/bin/mkdir/mkdir.c
and error shown are
mkdir.c: In function ‘main’:
mkdir.c:94:12: warning: assignment makes pointer from integer without a cast
here is my code.
#include<iostream>
int main()
{
std::string str;
while(true)
{
std::cout<<"enter string \n";
alarm(3);
getline(std::cin,str);
// calling another function in some other class,
and return to here (If not entered any string in 3 sec)
}
return 0;
}
after 2 sec it is exiting from my program.
Code:
import std.stdio;
main() {
writeln("Hello, world!\n");
exit (0);
}
This is the error I get :
Code:
clscr.d:3: function declaration without return type. (Note that constructors are always named 'this')
clscr.d:3: no identifier for declarator main()
Thank you in advance!