- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 14
- Posts with Downvotes
- 5
- Downvoting Members
- 8
37 Posted Topics
Re: [CODE] if(wParam == WM_LBUTTONDOWN) { counter++; printf("Count: $i\n", counter); } if(wParam == WM_RBUTTONDOWN){ counter++; printf("Count: $i\n", counter); } [/CODE] | |
Re: ok here is the program :) Imports System.IO Public Class Form1 Private pf As New Font("Arial", 10) 'this font will be used for the print Private sr As StreamReader Private Sub btnPrint_Click(sender As System.Object, e As System.EventArgs) Handles btnPrint.Click Try sr = New StreamReader("D:\My Documents\History of the Amiga.txt") Try pd.Print() … | |
Re: TxtName.Text = "value" is how you assign to the TxtName text field | |
Re: you could use cin.read(c, ONE_BYTE_LENGTH_CONST ); or hard code it to cin.read(c, 1); I did not try it if it could have a bug or so, just so you know/try. | |
Re: pList[i] is the value of what in that memory address, pList is the address of the first element, &pList[i] is the address of that element number i however, so pList+i is the address still as &pList[i] Just explore them | |
Re: you may try this, open the file, and check if it exist, if its not exist, open with win 7 file path format, and test again, on of them should give you a file stream object, char NotesDir[] = "\\Program Files\\notesw32"; char Fname[] = "C:\\Program Files\\notesw32\\notes.ini"; char Bakname[] = "C:\\Program … | |
Re: sometime when using > printf("%s\n",buf); it prints junk and commands which maybe sometimes show nothing, what I recomment try the next code line instead cout.write(buf, 4) << endl; | |
Re: you can work around it if you know the the array values range. let say you never expect the array to have value of -1 or a value or '$' you can do the following. #define END_OF_STR '$' size_t getArrSize(const char * ptr) { char *ptrIn = ptr; size_t size … | |
Re: from Wiki site I got this, u chnage it according to ur assignment, thats all I can tell you #include <stdio.h> /* printf, stderr, fprintf */ #include <sys/types.h> /* pid_t */ #include <unistd.h> /* _exit, fork */ #include <stdlib.h> /* exit */ #include <errno.h> /* errno */ int main(void) { … | |
Re: what language are you using, I have done this once in Java, but not as AS3 Style. if you use graphic interface class in C# it will work easy | |
Re: Didnt try this, however, if it works then its great, do if(data != NULL) { x = getchar(); while( x != NULL ) { x = toupper(x); putchar(x); x = getchar(); } } | |
Re: Yea GetDistance is very useful, I had a project where I used this alot, this is usful when using 2D or more | |
Re: I would change one thing and test, hope it works unsigned int read_val() { unsigned char i; unsigned int data=0;//initially zero for(i=0;i<=15;i++) { data<<=1; if(PINB==1) {data|=1;} else { data&=0; } } return data; } | |
Re: char * pch; pch=strchr(str,','); while (pch!=NULL) { pch=strchr(pch+1,','); } this is an example, of one way how you achieve your goal, it will find the locations of , for you, however you need to get the location of those , and use a function called strcpy to get the string … | |
Re: you dont need this line I think. [CODE]while(n!=1)[/CODE] before executing this line you need an if statement [CODE]return n*fac(--n);[/CODE] if n == 0 or 1, return 1, else [CODE]return n*fac(--n);[/CODE] | |
Re: I am sure whay this have many problem, if you want to know what problem you got, you have to have an organized code. see this example I organized it for you see before and after. Before [CODE] // system("cls"); printf("\tQ4.A syringe contains 60.0 mL of air at 740 mm … | |
Re: printf("\n\n Char value p : %.2x",(unsigned int)*p[1]) try this, p is a pointer so you need to see what it point to, by using *P to see what in that address, the value its self | |
Re: I think it return 0 if they are equal, however, return either a positive or negative value of the difference, can be -2 or 4 5 anything. | |
Re: [CODE]fd = open("/dev/ttyS0", O_RDONLY | O_NOCTTY | O_NDELAY );[/CODE] it not gonna work if you use O_RDONLY tag, because you tell the fd that I can use to read stuff, not to write into it. so try this [CODE]fd = open("/dev/ttyS0", O_NOCTTY | O_NDELAY );[/CODE] | |
Re: [QUOTE]if (operation == 'A' || 'a')[/QUOTE] as what Lerner said, and by the way it should be written as [CODE]if (operation == 'A' || operation == 'a')[/CODE] other than this I think it should work | |
Re: doesnt look that hard, I bet you have a lot of simillar example if you have notes?? the only problem I cant help you because I am doing a project taking me a month of non stop coding, :/ | |
Re: [CODE]queue(pID,0,0);[/CODE] this this function.,this can decrements the PID. other thing. are did you mean to not break out the switch case staement? [CODE] switch(tempA) { case 0:CPU(tempA); break; //like after each case case 1:CPU(tempA); case 2:CPU(tempA); case 3:CPU(tempA); }[/CODE] similar to here [CODE]switch(ran) { case 0: killProcess(); // process terminates … | |
Re: I am not sure, but usually for beginner, \ -usually get tasks like find this type of bug and how it happen then find a solution. -Add something new to an existing software. -modify some software to match a new customer need and requirements. but software engineer usually higher level, … | |
Re: [URL="http://www.youtube.com/watch?v=o_RKfLrmCEs&context=C3cbd723ADOEgsToPDskJWVxdBXnQKZTM1oolwNqVz"]http://www.youtube.com/watch?v=o_RKfLrmCEs&context=C3cbd723ADOEgsToPDskJWVxdBXnQKZTM1oolwNqVz[/URL] this tutorial is the best shot for you. very helpful. its in C, but can be used in C++ | |
Re: If you use the variable in global scope then you dont have to pass anything to the function, your function declaration had no parameters,, and the function itself has 4. The function name was misspelled welcomemessage instead of welcomeMessage and needed () at the end [QUOTE]welcomeMessage()[/QUOTE] [CODE] #include <iostream> #include … | |
Re: I will show you what I did to make it work may be what you like You may ask if you get it or not. But not sure, if it doesn't work for you, it started and I was able to see it running. [CODE]#include <stdio.h> void hangman (void) { … | |
Re: If you get a linking error, make sure your functions names are exactly same as their prototypes. so, see if you might misspelled something | |
Re: ok I will give you some idea, I have done it before, and I am pretty sure it can be done way easier, but if you just like to use your head and implement it no matter what then continue to read, There is WAY better solution the, but I … | |
![]() | Re: Ok you have to make one change, in Project2.cpp [CODE] . . . using namespace std; #define N 1000 //void printArray(Investment, int); //HERE //make it this way void printArray(Investment [], int); int main() { . . . [/CODE] |
Re: use a function called strcmp(char arr1, "passKeyAnythingHereToMatch") [CODE] scanf ("%s", &password) int strcmp ( const char * str1, const char * str2 ); is the prototype //Use this instead if (strcmp ( password, "11201993" ) != 0) //this mean they are not equal //if the returned value is 0 then … | |
Re: [CODE] char inputIsGood = 1;//<== this should be any number, NOT 0 do{ input = getInput(); if(intput == 9) inputIsGood = 0; }while(inputIsGood); [/CODE] this is an example,. there are many ways, not sure what type of imput u r trying to get, however, use if statement, and if you … | |
Re: you can do this if you like to have id similar to the counter [CODE] void initializ(seat plane[], int MAXCAP ) static int CurrentID = 1; for(i = 0; i < MAXCAP; i++) { plane[i].ID = CurrentID++; } [/CODE] [CODE] void initializ(seat plane[], int MAXCAP ) for(i = 0; i … | |
Re: gerard4143 code is very smart, maybe advanced. enum is a constant name, with an integer value, so if you like to print the name of it self, you have to make a function, or higher level Operator. if I do it with a function I will keep your code, and … | |
Re: well, Kernal is Huge, and will need a long study, It is very confusing if you dont know where to look, I am trying to learn it, but there are too many files. The problem If you like to modify it to serve you well, you need to know what … | |
Re: [code]class ship { private: // <==================== char Name[256]; vector<string> inventory; public: void setName(char *nam) { strcpy(Name, nam); cout << Name; } void addToInventory(string frt, string sec, string thir) { inventory.push_back (frt); inventory.push_back (sec); inventory.push_back (thir); cout << inventory[0]; //Is this really needed? } void listInventory() { for(int i=0;i<inventory.size();i++) { cout … | |
Re: [QUOTE=Exo1337;554118][code] #include <iostream> using namespace std; int main() { cout << "Please input 2 integers: "; cin >> firstNum >> secondNum; cout << endl; ////while (firstNum >= secondNum) <<-- Dont use it like that [/code] [/QUOTE] this way would be better, int i = firstNum; int sum = 0, sum2 … |