- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
8 Posted Topics
Re: here is the code for reversibg string [CODE] #include<stdio.h> #include<string.h> char * reverString( char *str) { int strsize, endword, wordReadPos writPos = 0; strsize = strlen(str) -1; char * buffer = (char*) malloc( strsize + 2); while(strsize > 0) { if(str[strsize] == ' ') { buffer[strsize++] = str[strsize--]; } else … | |
Re: both number are in the same string, this is what you do [CODE] int main(void) { FILE *fp; char ch[STR_SIZE]; int aInt; int bInt; fp = fopen("erogol.k","r"); fgets(ch, STR_SIZE, fp); aInt = atoi(ch[0]); bInt = atoi(ch[1]); printf("%d \n",bInt+aInt); return EXIT_SUCCESS; } [/CODE] | |
Re: what you need to do is change you if statement to switch statement and your while as follow: bool done = false while(!done){ put the code inside........} [CODE] cin >> choice; switch(choice){ case 1: ADD(); break; case 2: SUB(); break; case 3: MULT(); break; case 4: DIV(); break; case 5: … | |
Re: below is a code, hope it helps. [QUOTE]#include <iostream> #include <string> using namespace std; int main() { string str1 = "606", str2 = "605" str3; size_t pos; cout << "Please enter zip code: "; string = zipCode; getline(cin,zipCode); pos = zipCode.find("606"); str3 = zipCode.substr(pos + 3); if (str3 == str1 … | |
Re: change the for loop inside main to this : for( long unsigned int i = SIZE-1; i > 0; i--) | |
can anybody tell what's wrong with this code! //=========================================================================== // hybrid.cpp --this file implement the hybridlist class // Time-stamp: <2010-10-29 18:52:46 Dnambembe> // To compile: // g++ hybrid.cpp // Copyright (c) 2010 by Domingos Nambembe. All rights reserved. //=========================================================================== #include<iostream> #include<cstddef> //need NULL #include"hybrid.h" using namespace std; typedef NodeType* NodePtr; … | |
Hi, I am writing a code that reads input from user to create a linked list database at the same, time it write the data received in to binary file. when I run the program is supposed to prompt the user to enter the data for ten time, however the … |
The End.