1,494 Posted Topics

Member Avatar for chubbyy.putto

Instead of looping throught the arrays, I would try a function like memcmp().

Member Avatar for chubbyy.putto
0
210
Member Avatar for Capi

Try something like this. void displayTruck() { for (size_t i = 0; i < counter; ++i) std::cout << itemPtr[i]->getMaker() << itemPtr[i]->getCost() << std::endl; }

Member Avatar for gerard4143
0
154
Member Avatar for sarah.mathieson.7

Since replaceAll() returns void and doesn't change any global variables or state. What does this function accomplish?

Member Avatar for sarah.mathieson.7
0
166
Member Avatar for cambalinho
Member Avatar for batoul.dje

This forum is not a free tutoring service or a homework completion site. Post your question clearly, post your code clearly indicating where the problem is and post any other pertinent information or data.

Member Avatar for richieking
0
112
Member Avatar for COKEDUDE
Member Avatar for HenryR7

I think you'll find the answer here. Check the example. http://www.cplusplus.com/reference/istream/basic_istream/seekg/

Member Avatar for HenryR7
0
169
Member Avatar for qasim.khan.923724
Member Avatar for qasim.khan.923724
0
143
Member Avatar for leenana

Here's a big hint which counts the characters. #include <iostream> unsigned long vowels(char ca[], unsigned long v_num) { if ( ca[0] == '\0' ) return v_num; vowels(++ca, ++v_num); } int main(int argc, char** argv) { char str[] = "This is a string to check for vowels"; std::cout << "'" << …

Member Avatar for gerard4143
0
262
Member Avatar for mc3330418
Member Avatar for Syafiq_1

Why? Because C++ demands that functions are defined before they are used but you can define your functions like so. double fIntoCm(double); int main() { ... } double fIntoCm(double dIn) { double dCm; dCm = dIn*2.54; return (dCm); }

Member Avatar for gerard4143
0
190
Member Avatar for whatthebobo

You two errors on line one for (index = 1; index < SIZE; ++); for (index = 1; index < SIZE; ++index) {...}

Member Avatar for whatthebobo
0
170
Member Avatar for Samier999

I would go with an array of structures struct personal { std::string name; std::string phone; std::string DOB; }; personal per[10];

Member Avatar for richieking
0
351
Member Avatar for maryamalik

Here's a hollow square. I think? #include <iostream> int main(int argc, char** argv) { unsigned int count = 12; for (size_t i = 0; i < count; ++i) { if ( i == 0 ) { std::cout << std::string (count, 'x') << std::endl; continue; } if ( i == count …

Member Avatar for gerard4143
0
128
Member Avatar for daProgramma

Did you try reading this link? http://msdn.microsoft.com/en-us/library/ys435b3s%28v=vs.110%29.aspx

Member Avatar for daProgramma
0
342
Member Avatar for vampersie

The basic way is to save the input into a string and then check each character for validity.

Member Avatar for saeidzamani
0
151
Member Avatar for COKEDUDE

Your first example should work if the for loop terminates when i = 5. char str1[5] = "code"; char str2[5] = "code"; for(i; i < 5; i++) { printf("The array length is %c %c :\n", str1[i], str2[i]); }

Member Avatar for Ancient Dragon
0
2K
Member Avatar for strRusty_gal

int chdir(const char *path); You can use chdir() which is in the unistd.h header file.

Member Avatar for strRusty_gal
0
240
Member Avatar for moon.fall.58

Should this have a reference to int? void ShowMenu(string& word, int choice); Something like. void ShowMenu(string& word, int & choice)

Member Avatar for tinstaafl
0
567
Member Avatar for asaidi

No. You have to take the source code over to a Windows compiler and recompile it into a Windows exe.

Member Avatar for iamthwee
0
108
Member Avatar for GamerDJX

You could try something like this: void check_string(const std::string str) { std::cout << "Got->" << str << std::endl; } void print_actors_movies(treePtr root, const std::string name) { if(root == NULL) return; if (root->left) print_actors_movies(root->left, name); std::for_each(root->actors.begin(), root->actors.end(), check_string); if (root->right) print_actors_movies(root->right, name); } I'll leave it to you to check if …

Member Avatar for GamerDJX
0
252
Member Avatar for qhweeman

#include <iostream> int main() { //prompt for integers //read/extract integers into variables //do calculations }

Member Avatar for Jamblaster
0
169
Member Avatar for VUEKID
Member Avatar for skyyadav

You have this gcc -std=c++11 -std=c++0x -W -Wall tt1.cpp but should it be g++ -std=c++11 -std=c++0x -W -Wall tt1.cpp

Member Avatar for gerard4143
0
322
Member Avatar for LINDA NYARKO
Member Avatar for gerard4143
0
89
Member Avatar for salah_saleh

Are you looking for a default constructor which will initialize the std::vector member with the values 1, 4, 5 via the constructor initialization list without embracing the C++11 features?

Member Avatar for salah_saleh
0
352
Member Avatar for johnson_2

Not sure what your problem is. Are you trying to accomplish something like this? server.c #include <stdio.h> #include <stdlib.h> #include <arpa/inet.h> #include <strings.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <signal.h> #define DEFAULT_PROTOCOL 0 #define PORT 50000 #define MSG "\nGot the message!\n" int main(int argc, char**argv) { int listenfd, connfd, …

Member Avatar for johnson_2
0
612
Member Avatar for 9tontruck

Could it be this Class Please note the uppercase C Or could it be the missing semi-colon here class Base { Base(); ~Base(); void doSomrthing(); } Or here Class MyCLass : public Base{ std::string name; MyCLass(); ~MyCLass(); void init(); }

Member Avatar for Moschops
0
205
Member Avatar for VUEKID
Member Avatar for VUEKID
0
181
Member Avatar for charming-_-eyes
Member Avatar for MRehanQadri

Open your file(a.txt) and a temp file. Read the a.txt file writing the results to the temp file. If one of the characters to be written is B then write b first. Finally, delete a.txt and rename temp to a.txt.

Member Avatar for MRehanQadri
0
231
Member Avatar for CodyOebel

Try something like this #include <iostream> #include <fstream> int main() { std::ofstream fout("outdata"); for (size_t i = 0; i < 100; ++i) fout << "0x" << std::hex << i << std::endl; return 0; }

Member Avatar for gerard4143
0
140
Member Avatar for wschamps42

Are you having problems with the ternary operator? http://msdn.microsoft.com/en-us/library/e4213hs1%28v=vs.71%29.aspx

Member Avatar for wschamps42
0
177
Member Avatar for yksrmc

Are you looing for something like this? #!/usr/bin/perl use warnings; use strict; use autodie qw/open close/; print "Enter input filename->"; chomp(my $ifilename = <STDIN>); open(my $IFILE, "<", $ifilename); while ( <$IFILE> ) { chomp; my @data = split(/\t+/, $_); print "@data\n" unless ( $data[3] eq $data[4] )#print this to another …

Member Avatar for yksrmc
0
2K
Member Avatar for The Matrix

A better question would be - Hi guys, I would like to know How to blink console text using Windows or Mac or Linux.

Member Avatar for Ancient Dragon
0
217
Member Avatar for sandeepbajjuri
Re: perl

I would investigate pipes or popen. [Click Here](http://perldoc.perl.org/perlopentut.html)

Member Avatar for 2teez
0
184
Member Avatar for nah094020

Right click on the file in question and select properties. The properties window should have a field 'Full File Path'. If your looking to list the files for the entire project then try the main menu option Edit->Find and choose the proper file name patterns.

Member Avatar for nah094020
0
196
Member Avatar for tony75

Try this my @files = sort { $a cmp $b } readdir(DIR); I tried this and it worked. #!/usr/bin/perl use strict; use warnings; my $dir = 'directory_path'; opendir(DIR, $dir) or die $!; foreach( sort { $a cmp $b } readdir(DIR)) { next if (/^\./); print $_,"\n"; } closedir(DIR); exit 0;

Member Avatar for tony75
0
4K
Member Avatar for sanchit.saxena9450
Member Avatar for SoulofchaOs
Member Avatar for tinstaafl
0
226
Member Avatar for neocortex

[QUOTE=neocortex;1180862] Hence, what would be your recommendations and why? Keep in mind that I need Linux for work, thus, seeking for stability and speed over fun and gloom. [/QUOTE] What does that mean 'I need Linux for work'? Do we interpret this as - my Linux must be Debian based …

Member Avatar for bombay1982
0
392
Member Avatar for kemaletikan

[QUOTE=kemaletikan;1032697]Hi fellas, I have a question about disassembled code. I have a very simple assembly code that prints "Hello world" to screen. When I disassembled it by using nasm(ndisasm), I got a text file. After that I opened it and started to analyze it. However, in a section that comes …

Member Avatar for 010101
0
2K
Member Avatar for naui95
Member Avatar for sarah.mathieson.7
Member Avatar for Gonbe
0
243
Member Avatar for Redhaze46

[QUOTE=Redhaze46;1322805]how hard?[/QUOTE] Try making a parser first and then you'll start to see the 'how hard'.

Member Avatar for mrnutty
1
229
Member Avatar for mandysaini

[QUOTE=mandysaini;1071093]Hi Friends, I have heard that it isn't that simple to write a program in linux using c. Lots of commands n stuff.Please simplify what actually I've got to do to run turbo c++ in my linux laptop as I am a beginner.[/QUOTE] Its just as easy as any other …

Member Avatar for ghaveIT.000.
0
971
Member Avatar for MiniApocalypse

player->draw(s); //errors are these 3 lines, s is an undeclared identifier So where is s defined?

Member Avatar for MiniApocalypse
0
330
Member Avatar for gerard4143

Does anyone know how to do this? I attached a program that collects all the command line arguments into a map container noting how many times each command line argument occurs. Now I want to sort this map of information by loading a vector with iterators that point to each …

Member Avatar for vijayan121
0
524
Member Avatar for jeaninem71

Could you narrow down your problem to something smaller than the entire program? P.S. Please use an appropriate title for your posting. Need Help ASAP isn't very descriptive.

Member Avatar for np complete
0
336
Member Avatar for jeaninem71

The End.