-
June 12th, 2014, 02:07 AM
#1
Parsing CL arguments and Function call queue
I am trying to create program which will process command line arguments and define which functions should be run, with specific order and specific arguments.
This is my first problem:
Code:
// proccessing_args.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <string>
#include <iostream>
#include <conio.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
vector<string> cities;
cities.push_back("Seattle");
cities.push_back("Los Angeles");
// Use C++ "for each" construct syntax
// to iterate over "cities" vector
for(string& city : cities)
{
cout << city << endl;
}
_getch();
return 0;
}
proccessing_args\proccessing_args.cpp(20): error C2143: syntax error : missing ',' before ':'
refers to the line with for. I copied the code form here http://technologyriver.blogspot.com/...loop-in-c.html
Last edited by crazy boy; June 12th, 2014 at 02:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|