Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. powerb23

    string and integer concatenation

    How would i concatenate strings and integers. For example char* m = "there are "; char* n = " days" int x = 3; i would like something like char* ans = "there are 3 days" Your help will be appreciated
  2. powerb23

    linkage error

    Hi, I was wondering what causes this error: 'isPrime' was declared implicitly 'extern' and later static if i had my declarations as static int isPrime(int n){ ... } int doSomething(int m){ ... if (!isPrime(5)) /* do something */ } Your help will be appreciated
  3. powerb23

    Macro definition

    Hi Salem, Many thanks for your help. I really appreciated your help. I got it to work.
  4. powerb23

    Macro definition

    Hi, it's some homework and i can't figure out how they would do this by passing in only the filename as the parameter. To me, it would seem more logical if i passed in two paramters like this. #define IGNORELINE(fileHandle,c) ( while(c != '\n'){ c =...
  5. powerb23

    Macro definition

    Hi, I was having problems with how to put a while loop that ignores a line in a macro. I had: #define IGNORELINE(fileHandle) ( while(c != '\n'){ c = fget(fileHandle); if(c == EOF)...
  6. powerb23

    Macro definition

    Thanks for the reply. Your help was really appreciated.
  7. powerb23

    Macro definition

    Hi, I would like to define a macro that returns 0 if it cannot open the file and returns 1 if it opens the file. For example; #define OPEN(fileHandle) (fileHandle = fopen("blah.dat", "r")) I would like to use conditional logic but not sure of how to go around it. In this...
  8. powerb23

    fscanf(....) question.

    Thanks for all your help. I now understand what happens Much thanks again
  9. powerb23

    fscanf(....) question.

    Hi, I would like to write an fscanf statement to read the first integer value at the start of the line.This is what i was using: int c = 0; int sr = fscanf(inFile, "%d", &c); I was puzzled as to why this returned a value of 1 when the line contained: 8as 12 Your help will be...
  10. powerb23

    pointer to an array in a function

    Thanks alot for the help. i used the for loop and got the program up and running. All your help has been greatly appreciated
  11. powerb23

    pointer to an array in a function

    Hi, I wanted to find out how i would point to the array arr in function get(char *p) so that i ould print the contents of this array. Your help will be appreciated. int main(){ char * ptr = NULL: get(ptr); printf("contents: %s:, ptr); } void get(char *p){ char [5]mm = NULL...

Part and Inventory Search

Back
Top